diff --git a/app/build.gradle b/app/build.gradle index 8a0ca3f..5ce6144 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,29 @@ +buildscript { + repositories { + maven { url 'https://maven.fabric.io/public' } + } + + dependencies { + classpath 'io.fabric.tools:gradle:1.+' + } +} apply plugin: 'com.android.application' +apply plugin: 'io.fabric' + +repositories { + maven { url 'https://maven.fabric.io/public' } +} + android { - compileSdkVersion 24 - buildToolsVersion "24.0.2" + compileSdkVersion 25 + buildToolsVersion '25.0.0' defaultConfig { applicationId "net.bluehack.kiosk" minSdkVersion 17 - targetSdkVersion 24 - versionCode 0 - versionName "0.1" + targetSdkVersion 25 + versionCode 3 + versionName "0.0.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -17,26 +32,36 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + useLibrary 'org.apache.http.legacy' } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:24.+' - compile 'com.google.android.gms:play-services-maps:10.0.1' - compile 'com.google.android.gms:play-services:10.0.1' + compile 'com.android.support:appcompat-v7:25.2.0' + compile 'com.android.support:design:25.2.0' + compile 'com.android.support:cardview-v7:25.2.0' + compile 'com.android.support:recyclerview-v7:25.2.0' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' - compile 'com.android.support:design:24.0.0' - compile 'com.synnapps:carouselview:0.0.10' - compile 'com.android.support:cardview-v7:24.2.1' - compile 'com.android.support:recyclerview-v7:24.2.1' + compile 'com.google.firebase:firebase-auth:10.0.1' compile 'com.squareup:otto:1.3.7' + compile 'com.github.bumptech.glide:glide:3.7.0' + compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.squareup.okhttp3:okhttp:3.2.0' - compile 'noman.placesapi:placesAPI:1.1.3' + compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' testCompile 'junit:junit:4.12' + compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') { + transitive = true; + } + compile "org.apache.httpcomponents:httpclient-android:4.3.3" + compile 'com.mcxiaoke.volley:library:1.0.19' + compile 'io.swagger:swagger-annotations:1.5.13' + compile 'com.belladati:httpclientandroidlib:4.3.0' + compile 'com.tsengvn:Typekit:1.0.0' + compile 'com.google.android.gms:play-services-analytics:10.0.1' } -apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json index dbadaf8..7654974 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -26,7 +26,10 @@ ], "services": { "analytics_service": { - "status": 1 + "status": 1, + "analytics_property": { + "tracking_id": "UA-99305451-1" + } }, "appinvite_service": { "status": 1, diff --git a/app/libs/aws-android-sdk-apigateway-core-0.0.1.jar b/app/libs/aws-android-sdk-apigateway-core-0.0.1.jar deleted file mode 100644 index ae09b8b..0000000 Binary files a/app/libs/aws-android-sdk-apigateway-core-0.0.1.jar and /dev/null differ diff --git a/app/libs/aws-android-sdk-apigateway-core-2.3.8.jar b/app/libs/aws-android-sdk-apigateway-core-2.3.8.jar deleted file mode 100644 index e834735..0000000 Binary files a/app/libs/aws-android-sdk-apigateway-core-2.3.8.jar and /dev/null differ diff --git a/app/libs/aws-android-sdk-core-2.3.8.jar b/app/libs/aws-android-sdk-core-2.3.8.jar deleted file mode 100644 index 82cfe86..0000000 Binary files a/app/libs/aws-android-sdk-core-2.3.8.jar and /dev/null differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e8dc0c1..45c2f4c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,69 +2,108 @@ - - - + android:name="com.google.android.gms.analytics.globalConfigResource" + android:resource="@xml/global_tracker" /> + + + + + + + + + + + + + + + + + + + + - - - - + android:label="@string/tool_bar_store" + android:screenOrientation="portrait"> - - + android:name=".myinfo.MyInfoActivity" + android:label="@string/tool_bar_myinfo" + android:screenOrientation="portrait"> - - + android:name=".subcategory.SubCategoryActivity" + android:label="@string/tool_bar_subcategory" + android:screenOrientation="portrait"> - + android:name=".menu.MenuActivity" + android:screenOrientation="portrait"> + - + android:name=".cart.CartMenuActivity" + android:label="@string/tool_bar_cart_menu" + android:screenOrientation="portrait"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/Roboto-Black.ttf b/app/src/main/assets/Roboto-Black.ttf new file mode 100644 index 0000000..689fe5c Binary files /dev/null and b/app/src/main/assets/Roboto-Black.ttf differ diff --git a/app/src/main/java/io/swagger/client/ApiClient.java b/app/src/main/java/io/swagger/client/ApiClient.java new file mode 100644 index 0000000..30a1d32 --- /dev/null +++ b/app/src/main/java/io/swagger/client/ApiClient.java @@ -0,0 +1,295 @@ +package io.swagger.client; + +import android.content.Context; +import android.os.AsyncTask; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +import io.swagger.client.api.AccountApi; +import io.swagger.client.api.CategoryApi; +import io.swagger.client.api.MenuApi; +import io.swagger.client.api.OrderApi; +import io.swagger.client.api.StoreApi; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.LoginReq; +import io.swagger.client.model.LoginRes; +import io.swagger.client.model.MenuOptionReq; +import io.swagger.client.model.MenuOptionRes; +import io.swagger.client.model.MenuReq; +import io.swagger.client.model.MenuRes; +import io.swagger.client.model.OrderCompleteReq; +import io.swagger.client.model.OrderCompleteRes; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; +import io.swagger.client.model.StoresReq; +import io.swagger.client.model.StoresRes; +import io.swagger.client.model.SubcategoryReq; +import io.swagger.client.model.SubcategoryRes; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class ApiClient { + private static final String TAG = makeLogTag(ApiClient.class); + private static ApiClient ourInstance = new ApiClient(); + private final String header = "application/json"; + + public static ApiClient getInstance() { + return ourInstance; + } + + private ApiClient() { + } + + public interface ApiResponseListener { + void onResponse(Object result); + } + + public void accountLoginPost(final Context context, final LoginReq loginReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + LoginRes output = null; + AccountApi api = new AccountApi(); + try { + output = api.accountLoginPost(header, loginReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void storesAccountListPost(final Context context, final StoresReq storesReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + StoresRes output = null; + StoreApi api = new StoreApi(); + try { + output = api.storeAccountListPost(header, storesReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void categoryListMenuPost(final Context context, final SubcategoryReq subcategoryReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + SubcategoryRes output = null; + CategoryApi api = new CategoryApi(); + try { + output = api.categoryListMenuPost(header, subcategoryReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void menuListPost(final Context context, final MenuReq menuReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + MenuRes output = null; + MenuApi api = new MenuApi(); + try { + output = api.menuListPost(header, menuReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void menuDetailPost(final Context context, final MenuOptionReq menuOptionReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + MenuOptionRes output = null; + MenuApi api = new MenuApi(); + try { + output = api.menuDetailPost(header, menuOptionReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void orderPaymentListPost(final Context context, final OrderReq orderReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + OrderRes output = null; + OrderApi api = new OrderApi(); + try { + output = api.orderPaymentListPost(header, orderReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void ordersAddPost(final Context context, final AddOrderReq addOrderReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + AddOrderRes output = null; + OrderApi api = new OrderApi(); + try { + output = api.orderAddPost(header, addOrderReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } + + public void ordersPaymentCompletePost(final Context context, final OrderCompleteReq orderCompleteReq, final ApiResponseListener listener) { + new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + + OrderCompleteRes output = null; + OrderApi api = new OrderApi(); + try { + output = api.orderPaymentCompletePost(header, orderCompleteReq); + LOGD(TAG, "output =>" + UiUtil.toStringGson(output)); + listener.onResponse(output); + } catch (TimeoutException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ExecutionException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (InterruptedException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } catch (ApiException e) { + e.printStackTrace(); + NetworkManager.getInstance().showServerErrorPopup(context); + } + return null; + } + + }.execute(); + } +} + diff --git a/app/src/main/java/io/swagger/client/ApiException.java b/app/src/main/java/io/swagger/client/ApiException.java new file mode 100644 index 0000000..10fbea7 --- /dev/null +++ b/app/src/main/java/io/swagger/client/ApiException.java @@ -0,0 +1,54 @@ +/** + * Kiosk API + *

+ *

+ * OpenAPI spec version: 0.0.1 + *

+ *

+ * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client; + +public class ApiException extends Exception { + int code = 0; + String message = null; + + public ApiException() { + } + + public ApiException(int code, String message) { + this.code = code; + this.message = message; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/app/src/main/java/io/swagger/client/ApiInvoker.java b/app/src/main/java/io/swagger/client/ApiInvoker.java new file mode 100644 index 0000000..67f0f50 --- /dev/null +++ b/app/src/main/java/io/swagger/client/ApiInvoker.java @@ -0,0 +1,542 @@ +/** + * Kiosk API + *

+ *

+ * OpenAPI spec version: 0.0.1 + *

+ *

+ * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client; + +import com.android.volley.Cache; +import com.android.volley.Network; +import com.android.volley.Request; +import com.android.volley.RequestQueue; +import com.android.volley.Response; +import com.android.volley.ResponseDelivery; +import com.android.volley.toolbox.BasicNetwork; +import com.android.volley.toolbox.HttpStack; +import com.android.volley.toolbox.HurlStack; +import com.android.volley.toolbox.NoCache; +import com.android.volley.toolbox.RequestFuture; +import com.google.gson.JsonParseException; + +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import io.swagger.client.auth.Authentication; +import io.swagger.client.auth.ApiKeyAuth; +import io.swagger.client.auth.HttpBasicAuth; +import io.swagger.client.request.GetRequest; +import io.swagger.client.request.PostRequest; +import io.swagger.client.request.PutRequest; +import io.swagger.client.request.DeleteRequest; +import io.swagger.client.request.PatchRequest; + +public class ApiInvoker { + private static ApiInvoker INSTANCE; + private Map defaultHeaderMap = new HashMap(); + + private RequestQueue mRequestQueue; + + private Map authentications; + + private int connectionTimeout; + + /** Content type "text/plain" with UTF-8 encoding. */ + public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); + + /** + * ISO 8601 date time format. + */ + public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + + /** + * ISO 8601 date format. + */ + public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + static { + // Use UTC as the default time zone. + DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + } + + public static void setUserAgent(String userAgent) { + INSTANCE.addDefaultHeader("User-Agent", userAgent); + } + + public static Date parseDateTime(String str) { + try { + return DATE_TIME_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + public static Date parseDate(String str) { + try { + return DATE_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + public static String formatDateTime(Date datetime) { + return DATE_TIME_FORMAT.format(datetime); + } + + public static String formatDate(Date date) { + return DATE_FORMAT.format(date); + } + + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDateTime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + Format to {@code Pair} objects. + */ + public static List parameterToPairs(String collectionFormat, String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()) { + return params; + } + + // get the collection format + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + + // create the params based on the collection format + if (collectionFormat.equals("multi")) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if (collectionFormat.equals("csv")) { + delimiter = ","; + } else if (collectionFormat.equals("ssv")) { + delimiter = " "; + } else if (collectionFormat.equals("tsv")) { + delimiter = "\t"; + } else if (collectionFormat.equals("pipes")) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder(); + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + public static void initializeInstance() { + initializeInstance(null); + } + + public static void initializeInstance(Cache cache) { + initializeInstance(cache, null, 0, null, 30); + } + + public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); + setUserAgent("Swagger-Codegen/1.0.0/android"); + + // Setup authentications (key: authentication name, value: authentication). + INSTANCE.authentications = new HashMap(); + // Prevent the authentications from being modified. + INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications); + } + + private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + if (cache == null) cache = new NoCache(); + if (network == null) { + HttpStack stack = new HurlStack(); + network = new BasicNetwork(stack); + } + + if (delivery == null) { + initConnectionRequest(cache, network); + } else { + initConnectionRequest(cache, network, threadPoolSize, delivery); + } + this.connectionTimeout = connectionTimeout; + } + + public static ApiInvoker getInstance() { + if (INSTANCE == null) { + initializeInstance(); + } + return INSTANCE; + } + + public void addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + } + + public String escapeString(String str) { + return str; + } + + public static Object deserialize(String json, String containerType, Class cls) throws ApiException { + try { + if ("list".equalsIgnoreCase(containerType) || "array".equalsIgnoreCase(containerType)) { + return JsonUtil.deserializeToList(json, cls); + } else if (String.class.equals(cls)) { + if (json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) + return json.substring(1, json.length() - 1); + else + return json; + } else { + return JsonUtil.deserializeToObject(json, cls); + } + } catch (JsonParseException e) { + throw new ApiException(500, e.getMessage()); + } + } + + public static String serialize(Object obj) throws ApiException { + try { + if (obj != null) + return JsonUtil.serialize(obj); + else + return null; + } catch (Exception e) { + throw new ApiException(500, e.getMessage()); + } + } + + /** + * Get authentications (key: authentication name, value: authentication). + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + public void setConnectionTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + } + + public int getConnectionTimeout() { + return connectionTimeout; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + */ + private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { + RequestFuture future = RequestFuture.newFuture(); + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); + if (request != null) { + mRequestQueue.add(request); + return future.get(connectionTimeout, TimeUnit.SECONDS); + } else return "no data"; + } + + public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); + if (request != null) mRequestQueue.add(request); + } + + public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + StringBuilder b = new StringBuilder(); + b.append("?"); + + updateParamsForAuth(authNames, queryParams, headerParams); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (!queryParam.getName().isEmpty()) { + b.append(escapeString(queryParam.getName())); + b.append("="); + b.append(escapeString(queryParam.getValue())); + b.append("&"); + } + } + } + + String querystring = b.substring(0, b.length() - 1); + String url = host + path + querystring; + + HashMap headers = new HashMap(); + + for (String key : headerParams.keySet()) { + headers.put(key, headerParams.get(key)); + } + + for (String key : defaultHeaderMap.keySet()) { + if (!headerParams.containsKey(key)) { + headers.put(key, defaultHeaderMap.get(key)); + } + } + headers.put("Accept", "application/json"); + + // URL encoded string from form parameters + String formParamStr = null; + + // for form data + if ("application/x-www-form-urlencoded".equals(contentType)) { + StringBuilder formParamBuilder = new StringBuilder(); + + // encode the form params + for (String key : formParams.keySet()) { + String value = formParams.get(key); + if (value != null && !"".equals(value.trim())) { + if (formParamBuilder.length() > 0) { + formParamBuilder.append("&"); + } + try { + formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8")); + } catch (Exception e) { + // move on to next + } + } + } + formParamStr = formParamBuilder.toString(); + } + Request request = null; + + if ("GET".equals(method)) { + request = new GetRequest(url, headers, null, stringRequest, errorListener); + } else if ("POST".equals(method)) { + request = null; + if (formParamStr != null) { + try { + request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PostRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + try { + request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + } else { + request = new PostRequest(url, headers, null, null, stringRequest, errorListener); + } + } else if ("PUT".equals(method)) { + request = null; + if (formParamStr != null) { + try { + request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PutRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + try { + request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + } else { + request = new PutRequest(url, headers, null, null, stringRequest, errorListener); + } + } else if ("DELETE".equals(method)) { + request = null; + if (formParamStr != null) { + try { + request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new DeleteRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + try { + request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + } else { + request = new DeleteRequest(url, headers, null, null, stringRequest, errorListener); + } + } else if ("PATCH".equals(method)) { + request = null; + if (formParamStr != null) { + try { + request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PatchRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + try { + request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + } else { + request = new PatchRequest(url, headers, null, null, stringRequest, errorListener); + } + } + return request; + } + + private void initConnectionRequest(Cache cache, Network network) { + mRequestQueue = new RequestQueue(cache, network); + mRequestQueue.start(); + } + + private void initConnectionRequest(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) { + mRequestQueue = new RequestQueue(cache, network, threadPoolSize, delivery); + mRequestQueue.start(); + } + + public void stopQueue() { + mRequestQueue.stop(); + } +} diff --git a/app/src/main/java/io/swagger/client/JsonUtil.java b/app/src/main/java/io/swagger/client/JsonUtil.java new file mode 100644 index 0000000..e6c6c01 --- /dev/null +++ b/app/src/main/java/io/swagger/client/JsonUtil.java @@ -0,0 +1,375 @@ +/** + * Kiosk API + *

+ *

+ * OpenAPI spec version: 0.0.1 + *

+ *

+ * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.List; + +import io.swagger.client.model.*; + +public class JsonUtil { + public static GsonBuilder gsonBuilder; + + static { + gsonBuilder = new GsonBuilder(); + gsonBuilder.serializeNulls(); + gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + } + + public static Gson getGson() { + return gsonBuilder.create(); + } + + public static String serialize(Object obj) { + return getGson().toJson(obj); + } + + public static T deserializeToList(String jsonString, Class cls) { + return getGson().fromJson(jsonString, getListTypeForDeserialization(cls)); + } + + public static T deserializeToObject(String jsonString, Class cls) { + return getGson().fromJson(jsonString, getTypeForDeserialization(cls)); + } + + public static Type getListTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("AddOrderReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("AddOrderReqDetail".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("AddOrderReqOption".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("AddOrderRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("AddOrderResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("LoginReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("LoginRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("LoginResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuOptionReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuOptionRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuOptionResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuOptionResData1".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuOptionResOptions".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("MenuResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderCompleteReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderCompleteRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderCompleteResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderResDetail".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("OrderResOption".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("StoresReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("StoresRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("StoresResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("SubcategoryReq".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("SubcategoryRes".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + if ("SubcategoryResData".equalsIgnoreCase(className)) { + return new TypeToken>() { + }.getType(); + } + + return new TypeToken>() { + }.getType(); + } + + public static Type getTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("AddOrderReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("AddOrderReqDetail".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("AddOrderReqOption".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("AddOrderRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("AddOrderResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("LoginReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("LoginRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("LoginResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuOptionReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuOptionRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuOptionResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuOptionResData1".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuOptionResOptions".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("MenuResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderCompleteReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderCompleteRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderCompleteResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderResDetail".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("OrderResOption".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("StoresReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("StoresRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("StoresResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("SubcategoryReq".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("SubcategoryRes".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + if ("SubcategoryResData".equalsIgnoreCase(className)) { + return new TypeToken() { + }.getType(); + } + + return new TypeToken() { + }.getType(); + } + +}; diff --git a/app/src/main/java/io/swagger/client/Pair.java b/app/src/main/java/io/swagger/client/Pair.java new file mode 100644 index 0000000..ca6433a --- /dev/null +++ b/app/src/main/java/io/swagger/client/Pair.java @@ -0,0 +1,62 @@ +/** + * Kiosk API + *

+ *

+ * OpenAPI spec version: 0.0.1 + *

+ *

+ * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client; + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair(String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) return; + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) return; + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; + + return true; + } +} diff --git a/app/src/main/java/io/swagger/client/api/AccountApi.java b/app/src/main/java/io/swagger/client/api/AccountApi.java new file mode 100644 index 0000000..40893c4 --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/AccountApi.java @@ -0,0 +1,225 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.Pair; + +import io.swagger.client.model.*; + +import java.io.UnsupportedEncodingException; +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.belladati.httpclientandroidlib.entity.mime.MultipartEntityBuilder; + +import io.swagger.client.model.LoginRes; +import io.swagger.client.model.LoginReq; + +import org.apache.http.HttpEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class AccountApi { + String basePath = BasePath.getInstance().getBasePath(); + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * + * + * @param contentType + * @param loginReq + * @return LoginRes + */ + public LoginRes accountLoginPost (String contentType, LoginReq loginReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = loginReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling accountLoginPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling accountLoginPost")); + } + + // verify the required parameter 'loginReq' is set + if (loginReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'loginReq' when calling accountLoginPost", + new ApiException(400, "Missing the required parameter 'loginReq' when calling accountLoginPost")); + } + + + // create path and map variables + String path = "/account/login".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = null; + localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (LoginRes) ApiInvoker.deserialize(localVarResponse, "", LoginRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param loginReq + */ + public void accountLoginPost (String contentType, LoginReq loginReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = loginReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling accountLoginPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling accountLoginPost")); + } + + // verify the required parameter 'loginReq' is set + if (loginReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'loginReq' when calling accountLoginPost", + new ApiException(400, "Missing the required parameter 'loginReq' when calling accountLoginPost")); + } + + + // create path and map variables + String path = "/account/login".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((LoginRes) ApiInvoker.deserialize(localVarResponse, "", LoginRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/app/src/main/java/io/swagger/client/api/BasePath.java b/app/src/main/java/io/swagger/client/api/BasePath.java new file mode 100644 index 0000000..8912c66 --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/BasePath.java @@ -0,0 +1,20 @@ +package io.swagger.client.api; + +public class BasePath { + + public BasePath(){} + + private static BasePath ourInstance = new BasePath(); + public static BasePath getInstance() { + return ourInstance; + } + private String basePath = "http://175.207.13.212:8080"; + + public String getBasePath() { + return basePath; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } +} diff --git a/app/src/main/java/io/swagger/client/api/CategoryApi.java b/app/src/main/java/io/swagger/client/api/CategoryApi.java new file mode 100644 index 0000000..4defe9a --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/CategoryApi.java @@ -0,0 +1,223 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.Pair; + +import io.swagger.client.model.*; + +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.belladati.httpclientandroidlib.entity.mime.MultipartEntityBuilder; + +import io.swagger.client.model.SubcategoryReq; +import io.swagger.client.model.SubcategoryRes; + +import org.apache.http.HttpEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class CategoryApi { + String basePath = BasePath.getInstance().getBasePath(); + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * + * + * @param contentType + * @param subcategoryReq + * @return SubcategoryRes + */ + public SubcategoryRes categoryListMenuPost (String contentType, SubcategoryReq subcategoryReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = subcategoryReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling categoryListMenuPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling categoryListMenuPost")); + } + + // verify the required parameter 'subcategoryReq' is set + if (subcategoryReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'subcategoryReq' when calling categoryListMenuPost", + new ApiException(400, "Missing the required parameter 'subcategoryReq' when calling categoryListMenuPost")); + } + + + // create path and map variables + String path = "/category/list-menu".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (SubcategoryRes) ApiInvoker.deserialize(localVarResponse, "", SubcategoryRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param subcategoryReq + */ + public void categoryListMenuPost (String contentType, SubcategoryReq subcategoryReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = subcategoryReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling categoryListMenuPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling categoryListMenuPost")); + } + + // verify the required parameter 'subcategoryReq' is set + if (subcategoryReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'subcategoryReq' when calling categoryListMenuPost", + new ApiException(400, "Missing the required parameter 'subcategoryReq' when calling categoryListMenuPost")); + } + + + // create path and map variables + String path = "/category/list-menu".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((SubcategoryRes) ApiInvoker.deserialize(localVarResponse, "", SubcategoryRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/app/src/main/java/io/swagger/client/api/MenuApi.java b/app/src/main/java/io/swagger/client/api/MenuApi.java new file mode 100644 index 0000000..4eb5c0e --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/MenuApi.java @@ -0,0 +1,377 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.Pair; + +import io.swagger.client.model.*; + +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.belladati.httpclientandroidlib.entity.mime.MultipartEntityBuilder; + +import io.swagger.client.model.MenuOptionRes; +import io.swagger.client.model.MenuOptionReq; +import io.swagger.client.model.MenuReq; +import io.swagger.client.model.MenuRes; + +import org.apache.http.HttpEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class MenuApi { + String basePath = BasePath.getInstance().getBasePath(); + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * + * + * @param contentType + * @param menuOptionReq + * @return MenuOptionRes + */ + public MenuOptionRes menuDetailPost (String contentType, MenuOptionReq menuOptionReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = menuOptionReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling menuDetailPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling menuDetailPost")); + } + + // verify the required parameter 'menuOptionReq' is set + if (menuOptionReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'menuOptionReq' when calling menuDetailPost", + new ApiException(400, "Missing the required parameter 'menuOptionReq' when calling menuDetailPost")); + } + + + // create path and map variables + String path = "/menu/detail".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (MenuOptionRes) ApiInvoker.deserialize(localVarResponse, "", MenuOptionRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param menuOptionReq + */ + public void menuDetailPost (String contentType, MenuOptionReq menuOptionReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = menuOptionReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling menuDetailPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling menuDetailPost")); + } + + // verify the required parameter 'menuOptionReq' is set + if (menuOptionReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'menuOptionReq' when calling menuDetailPost", + new ApiException(400, "Missing the required parameter 'menuOptionReq' when calling menuDetailPost")); + } + + + // create path and map variables + String path = "/menu/detail".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((MenuOptionRes) ApiInvoker.deserialize(localVarResponse, "", MenuOptionRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * + * @param contentType + * @param menuReq + * @return MenuRes + */ + public MenuRes menuListPost (String contentType, MenuReq menuReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = menuReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling menuListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling menuListPost")); + } + + // verify the required parameter 'menuReq' is set + if (menuReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'menuReq' when calling menuListPost", + new ApiException(400, "Missing the required parameter 'menuReq' when calling menuListPost")); + } + + + // create path and map variables + String path = "/menu/list".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (MenuRes) ApiInvoker.deserialize(localVarResponse, "", MenuRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param menuReq + */ + public void menuListPost (String contentType, MenuReq menuReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = menuReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling menuListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling menuListPost")); + } + + // verify the required parameter 'menuReq' is set + if (menuReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'menuReq' when calling menuListPost", + new ApiException(400, "Missing the required parameter 'menuReq' when calling menuListPost")); + } + + + // create path and map variables + String path = "/menu/list".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((MenuRes) ApiInvoker.deserialize(localVarResponse, "", MenuRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/app/src/main/java/io/swagger/client/api/OrderApi.java b/app/src/main/java/io/swagger/client/api/OrderApi.java new file mode 100644 index 0000000..c3e05bb --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/OrderApi.java @@ -0,0 +1,531 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.Pair; + +import io.swagger.client.model.*; + +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.belladati.httpclientandroidlib.entity.mime.MultipartEntityBuilder; + +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.OrderCompleteRes; +import io.swagger.client.model.OrderCompleteReq; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; + +import org.apache.http.HttpEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class OrderApi { + String basePath = BasePath.getInstance().getBasePath(); + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * + * + * @param contentType + * @param addOrderReq + * @return AddOrderRes + */ + public AddOrderRes orderAddPost (String contentType, AddOrderReq addOrderReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = addOrderReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderAddPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderAddPost")); + } + + // verify the required parameter 'addOrderReq' is set + if (addOrderReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addOrderReq' when calling orderAddPost", + new ApiException(400, "Missing the required parameter 'addOrderReq' when calling orderAddPost")); + } + + + // create path and map variables + String path = "/order/add".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (AddOrderRes) ApiInvoker.deserialize(localVarResponse, "", AddOrderRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param addOrderReq + */ + public void orderAddPost (String contentType, AddOrderReq addOrderReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = addOrderReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderAddPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderAddPost")); + } + + // verify the required parameter 'addOrderReq' is set + if (addOrderReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addOrderReq' when calling orderAddPost", + new ApiException(400, "Missing the required parameter 'addOrderReq' when calling orderAddPost")); + } + + + // create path and map variables + String path = "/order/add".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((AddOrderRes) ApiInvoker.deserialize(localVarResponse, "", AddOrderRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * + * @param contentType + * @param orderCompleteReq + * @return OrderCompleteRes + */ + public OrderCompleteRes orderPaymentCompletePost (String contentType, OrderCompleteReq orderCompleteReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = orderCompleteReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderPaymentCompletePost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderPaymentCompletePost")); + } + + // verify the required parameter 'orderCompleteReq' is set + if (orderCompleteReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderCompleteReq' when calling orderPaymentCompletePost", + new ApiException(400, "Missing the required parameter 'orderCompleteReq' when calling orderPaymentCompletePost")); + } + + + // create path and map variables + String path = "/order/payment-complete".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (OrderCompleteRes) ApiInvoker.deserialize(localVarResponse, "", OrderCompleteRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param orderCompleteReq + */ + public void orderPaymentCompletePost (String contentType, OrderCompleteReq orderCompleteReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = orderCompleteReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderPaymentCompletePost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderPaymentCompletePost")); + } + + // verify the required parameter 'orderCompleteReq' is set + if (orderCompleteReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderCompleteReq' when calling orderPaymentCompletePost", + new ApiException(400, "Missing the required parameter 'orderCompleteReq' when calling orderPaymentCompletePost")); + } + + + // create path and map variables + String path = "/order/payment-complete".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((OrderCompleteRes) ApiInvoker.deserialize(localVarResponse, "", OrderCompleteRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * + * @param contentType + * @param orderReq + * @return OrderRes + */ + public OrderRes orderPaymentListPost (String contentType, OrderReq orderReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = orderReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderPaymentListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderPaymentListPost")); + } + + // verify the required parameter 'orderReq' is set + if (orderReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderReq' when calling orderPaymentListPost", + new ApiException(400, "Missing the required parameter 'orderReq' when calling orderPaymentListPost")); + } + + + // create path and map variables + String path = "/order/payment-list".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (OrderRes) ApiInvoker.deserialize(localVarResponse, "", OrderRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param orderReq + */ + public void orderPaymentListPost (String contentType, OrderReq orderReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = orderReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling orderPaymentListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling orderPaymentListPost")); + } + + // verify the required parameter 'orderReq' is set + if (orderReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'orderReq' when calling orderPaymentListPost", + new ApiException(400, "Missing the required parameter 'orderReq' when calling orderPaymentListPost")); + } + + + // create path and map variables + String path = "/order/payment-list".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((OrderRes) ApiInvoker.deserialize(localVarResponse, "", OrderRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/app/src/main/java/io/swagger/client/api/StoreApi.java b/app/src/main/java/io/swagger/client/api/StoreApi.java new file mode 100644 index 0000000..6d027bc --- /dev/null +++ b/app/src/main/java/io/swagger/client/api/StoreApi.java @@ -0,0 +1,223 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.Pair; + +import io.swagger.client.model.*; + +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.belladati.httpclientandroidlib.entity.mime.MultipartEntityBuilder; + +import io.swagger.client.model.StoresReq; +import io.swagger.client.model.StoresRes; + +import org.apache.http.HttpEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class StoreApi { + String basePath = BasePath.getInstance().getBasePath(); + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * + * + * @param contentType + * @param storesReq + * @return StoresRes + */ + public StoresRes storeAccountListPost (String contentType, StoresReq storesReq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = storesReq; + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling storeAccountListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling storeAccountListPost")); + } + + // verify the required parameter 'storesReq' is set + if (storesReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'storesReq' when calling storeAccountListPost", + new ApiException(400, "Missing the required parameter 'storesReq' when calling storeAccountListPost")); + } + + + // create path and map variables + String path = "/store/accountList".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if(localVarResponse != null){ + return (StoresRes) ApiInvoker.deserialize(localVarResponse, "", StoresRes.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if(ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * + * @param contentType * @param storesReq + */ + public void storeAccountListPost (String contentType, StoresReq storesReq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = storesReq; + + + // verify the required parameter 'contentType' is set + if (contentType == null) { + VolleyError error = new VolleyError("Missing the required parameter 'contentType' when calling storeAccountListPost", + new ApiException(400, "Missing the required parameter 'contentType' when calling storeAccountListPost")); + } + + // verify the required parameter 'storesReq' is set + if (storesReq == null) { + VolleyError error = new VolleyError("Missing the required parameter 'storesReq' when calling storeAccountListPost", + new ApiException(400, "Missing the required parameter 'storesReq' when calling storeAccountListPost")); + } + + + // create path and map variables + String path = "/store/accountList".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("Content-Type", ApiInvoker.parameterToString(contentType)); + + String[] contentTypes = { + "application/json" + }; + contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + com.belladati.httpclientandroidlib.HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((StoresRes) ApiInvoker.deserialize(localVarResponse, "", StoresRes.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/app/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/app/src/main/java/io/swagger/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..f738fd3 --- /dev/null +++ b/app/src/main/java/io/swagger/client/auth/ApiKeyAuth.java @@ -0,0 +1,85 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + String value; + if (apiKey == null) { + return; + } + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } + } +} diff --git a/app/src/main/java/io/swagger/client/auth/Authentication.java b/app/src/main/java/io/swagger/client/auth/Authentication.java new file mode 100644 index 0000000..23cd5cb --- /dev/null +++ b/app/src/main/java/io/swagger/client/auth/Authentication.java @@ -0,0 +1,35 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** Apply authentication settings to header and query params. */ + void applyToParams(List queryParams, Map headerParams); +} diff --git a/app/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/app/src/main/java/io/swagger/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..a2c6b5d --- /dev/null +++ b/app/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -0,0 +1,59 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import android.util.Base64; + +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes(), Base64.DEFAULT)); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderReq.java b/app/src/main/java/io/swagger/client/model/AddOrderReq.java new file mode 100644 index 0000000..044de98 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderReq.java @@ -0,0 +1,170 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.AddOrderReqDetail; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderReq { + + @SerializedName("store_id") + private String storeId = null; + @SerializedName("user_id") + private String userId = null; + @SerializedName("price") + private String price = null; + @SerializedName("paymethod") + private String paymethod = null; + @SerializedName("points") + private String points = null; + @SerializedName("tax") + private String tax = null; + @SerializedName("detail") + private List detail = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getPrice() { + return price; + } + public void setPrice(String price) { + this.price = price; + } + + /** + * 현금,카드,포인트(0,1,0) + **/ + @ApiModelProperty(value = "현금,카드,포인트(0,1,0)") + public String getPaymethod() { + return paymethod; + } + public void setPaymethod(String paymethod) { + this.paymethod = paymethod; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getPoints() { + return points; + } + public void setPoints(String points) { + this.points = points; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getTax() { + return tax; + } + public void setTax(String tax) { + this.tax = tax; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getDetail() { + return detail; + } + public void setDetail(List detail) { + this.detail = detail; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderReq addOrderReq = (AddOrderReq) o; + return (storeId == null ? addOrderReq.storeId == null : storeId.equals(addOrderReq.storeId)) && + (userId == null ? addOrderReq.userId == null : userId.equals(addOrderReq.userId)) && + (price == null ? addOrderReq.price == null : price.equals(addOrderReq.price)) && + (paymethod == null ? addOrderReq.paymethod == null : paymethod.equals(addOrderReq.paymethod)) && + (points == null ? addOrderReq.points == null : points.equals(addOrderReq.points)) && + (tax == null ? addOrderReq.tax == null : tax.equals(addOrderReq.tax)) && + (detail == null ? addOrderReq.detail == null : detail.equals(addOrderReq.detail)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (userId == null ? 0: userId.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + result = 31 * result + (paymethod == null ? 0: paymethod.hashCode()); + result = 31 * result + (points == null ? 0: points.hashCode()); + result = 31 * result + (tax == null ? 0: tax.hashCode()); + result = 31 * result + (detail == null ? 0: detail.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderReq {\n"); + + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" userId: ").append(userId).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append(" paymethod: ").append(paymethod).append("\n"); + sb.append(" points: ").append(points).append("\n"); + sb.append(" tax: ").append(tax).append("\n"); + sb.append(" detail: ").append(detail).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderReqDetail.java b/app/src/main/java/io/swagger/client/model/AddOrderReqDetail.java new file mode 100644 index 0000000..7b093fb --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderReqDetail.java @@ -0,0 +1,109 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.AddOrderReqOption; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderReqDetail { + + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("quantity") + private String quantity = null; + @SerializedName("option") + private List option = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getQuantity() { + return quantity; + } + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getOption() { + return option; + } + public void setOption(List option) { + this.option = option; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderReqDetail addOrderReqDetail = (AddOrderReqDetail) o; + return (menuId == null ? addOrderReqDetail.menuId == null : menuId.equals(addOrderReqDetail.menuId)) && + (quantity == null ? addOrderReqDetail.quantity == null : quantity.equals(addOrderReqDetail.quantity)) && + (option == null ? addOrderReqDetail.option == null : option.equals(addOrderReqDetail.option)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (quantity == null ? 0: quantity.hashCode()); + result = 31 * result + (option == null ? 0: option.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderReqDetail {\n"); + + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" quantity: ").append(quantity).append("\n"); + sb.append(" option: ").append(option).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderReqOption.java b/app/src/main/java/io/swagger/client/model/AddOrderReqOption.java new file mode 100644 index 0000000..2f13f5e --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderReqOption.java @@ -0,0 +1,92 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderReqOption { + + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("quantity") + private String quantity = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getQuantity() { + return quantity; + } + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderReqOption addOrderReqOption = (AddOrderReqOption) o; + return (menuId == null ? addOrderReqOption.menuId == null : menuId.equals(addOrderReqOption.menuId)) && + (quantity == null ? addOrderReqOption.quantity == null : quantity.equals(addOrderReqOption.quantity)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (quantity == null ? 0: quantity.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderReqOption {\n"); + + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" quantity: ").append(quantity).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderRes.java b/app/src/main/java/io/swagger/client/model/AddOrderRes.java new file mode 100644 index 0000000..2e4035e --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderRes.java @@ -0,0 +1,110 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.AddOrderResData; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private AddOrderResData data = null; + + /** + * 성공유부 + **/ + @ApiModelProperty(value = "성공유부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답 메시지 + **/ + @ApiModelProperty(value = "응답 메시지") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public AddOrderResData getData() { + return data; + } + public void setData(AddOrderResData data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderRes addOrderRes = (AddOrderRes) o; + return (responseStatus == null ? addOrderRes.responseStatus == null : responseStatus.equals(addOrderRes.responseStatus)) && + (responseMsg == null ? addOrderRes.responseMsg == null : responseMsg.equals(addOrderRes.responseMsg)) && + (data == null ? addOrderRes.data == null : data.equals(addOrderRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderResData.java b/app/src/main/java/io/swagger/client/model/AddOrderResData.java new file mode 100644 index 0000000..0758d9c --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderResData.java @@ -0,0 +1,94 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.AddOrderResDataSoldOut; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderResData { + + @SerializedName("order_id") + private String orderId = null; + @SerializedName("soldOut") + private List soldOut = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderId() { + return orderId; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getSoldOut() { + return soldOut; + } + public void setSoldOut(List soldOut) { + this.soldOut = soldOut; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderResData addOrderResData = (AddOrderResData) o; + return (orderId == null ? addOrderResData.orderId == null : orderId.equals(addOrderResData.orderId)) && + (soldOut == null ? addOrderResData.soldOut == null : soldOut.equals(addOrderResData.soldOut)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderId == null ? 0: orderId.hashCode()); + result = 31 * result + (soldOut == null ? 0: soldOut.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderResData {\n"); + + sb.append(" orderId: ").append(orderId).append("\n"); + sb.append(" soldOut: ").append(soldOut).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/AddOrderResDataSoldOut.java b/app/src/main/java/io/swagger/client/model/AddOrderResDataSoldOut.java new file mode 100644 index 0000000..f6e18fa --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/AddOrderResDataSoldOut.java @@ -0,0 +1,92 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class AddOrderResDataSoldOut { + + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("menu_name") + private String menuName = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuName() { + return menuName; + } + public void setMenuName(String menuName) { + this.menuName = menuName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrderResDataSoldOut addOrderResDataSoldOut = (AddOrderResDataSoldOut) o; + return (menuId == null ? addOrderResDataSoldOut.menuId == null : menuId.equals(addOrderResDataSoldOut.menuId)) && + (menuName == null ? addOrderResDataSoldOut.menuName == null : menuName.equals(addOrderResDataSoldOut.menuName)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (menuName == null ? 0: menuName.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrderResDataSoldOut {\n"); + + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" menuName: ").append(menuName).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/LoginReq.java b/app/src/main/java/io/swagger/client/model/LoginReq.java new file mode 100644 index 0000000..e1a84f4 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/LoginReq.java @@ -0,0 +1,110 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class LoginReq { + + @SerializedName("account_id") + private String accountId = null; + @SerializedName("passwd") + private String passwd = null; + @SerializedName("push_token") + private String pushToken = null; + + /** + * login id + **/ + @ApiModelProperty(value = "login id") + public String getAccountId() { + return accountId; + } + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + /** + * login passward + **/ + @ApiModelProperty(value = "login passward") + public String getPasswd() { + return passwd; + } + public void setPasswd(String passwd) { + this.passwd = passwd; + } + + /** + * firebase token + **/ + @ApiModelProperty(value = "firebase token") + public String getPushToken() { + return pushToken; + } + public void setPushToken(String pushToken) { + this.pushToken = pushToken; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginReq loginReq = (LoginReq) o; + return (accountId == null ? loginReq.accountId == null : accountId.equals(loginReq.accountId)) && + (passwd == null ? loginReq.passwd == null : passwd.equals(loginReq.passwd)) && + (pushToken == null ? loginReq.pushToken == null : pushToken.equals(loginReq.pushToken)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (accountId == null ? 0: accountId.hashCode()); + result = 31 * result + (passwd == null ? 0: passwd.hashCode()); + result = 31 * result + (pushToken == null ? 0: pushToken.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginReq {\n"); + + sb.append(" accountId: ").append(accountId).append("\n"); + sb.append(" passwd: ").append(passwd).append("\n"); + sb.append(" pushToken: ").append(pushToken).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/LoginRes.java b/app/src/main/java/io/swagger/client/model/LoginRes.java new file mode 100644 index 0000000..c177e42 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/LoginRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.LoginResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class LoginRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공유부 + **/ + @ApiModelProperty(value = "성공유부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답메시지 + **/ + @ApiModelProperty(value = "응답메시지") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginRes loginRes = (LoginRes) o; + return (responseStatus == null ? loginRes.responseStatus == null : responseStatus.equals(loginRes.responseStatus)) && + (responseMsg == null ? loginRes.responseMsg == null : responseMsg.equals(loginRes.responseMsg)) && + (data == null ? loginRes.data == null : data.equals(loginRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/LoginResData.java b/app/src/main/java/io/swagger/client/model/LoginResData.java new file mode 100644 index 0000000..b43df63 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/LoginResData.java @@ -0,0 +1,122 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class LoginResData { + + @SerializedName("account_id") + private String accountId = null; + @SerializedName("name") + private String name = null; + @SerializedName("phone") + private String phone = null; + @SerializedName("status") + private Integer status = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getAccountId() { + return accountId; + } + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStatus() { + return status; + } + public void setStatus(Integer status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginResData loginResData = (LoginResData) o; + return (accountId == null ? loginResData.accountId == null : accountId.equals(loginResData.accountId)) && + (name == null ? loginResData.name == null : name.equals(loginResData.name)) && + (phone == null ? loginResData.phone == null : phone.equals(loginResData.phone)) && + (status == null ? loginResData.status == null : status.equals(loginResData.status)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (accountId == null ? 0: accountId.hashCode()); + result = 31 * result + (name == null ? 0: name.hashCode()); + result = 31 * result + (phone == null ? 0: phone.hashCode()); + result = 31 * result + (status == null ? 0: status.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginResData {\n"); + + sb.append(" accountId: ").append(accountId).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append(" phone: ").append(phone).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuOptionReq.java b/app/src/main/java/io/swagger/client/model/MenuOptionReq.java new file mode 100644 index 0000000..3658521 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuOptionReq.java @@ -0,0 +1,137 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuOptionReq { + + @SerializedName("store_id") + private String storeId = null; + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("orderBy") + private String orderBy = null; + @SerializedName("startNo") + private Integer startNo = null; + @SerializedName("cnt") + private Integer cnt = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderBy() { + return orderBy; + } + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStartNo() { + return startNo; + } + public void setStartNo(Integer startNo) { + this.startNo = startNo; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCnt() { + return cnt; + } + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuOptionReq menuOptionReq = (MenuOptionReq) o; + return (storeId == null ? menuOptionReq.storeId == null : storeId.equals(menuOptionReq.storeId)) && + (menuId == null ? menuOptionReq.menuId == null : menuId.equals(menuOptionReq.menuId)) && + (orderBy == null ? menuOptionReq.orderBy == null : orderBy.equals(menuOptionReq.orderBy)) && + (startNo == null ? menuOptionReq.startNo == null : startNo.equals(menuOptionReq.startNo)) && + (cnt == null ? menuOptionReq.cnt == null : cnt.equals(menuOptionReq.cnt)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (orderBy == null ? 0: orderBy.hashCode()); + result = 31 * result + (startNo == null ? 0: startNo.hashCode()); + result = 31 * result + (cnt == null ? 0: cnt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuOptionReq {\n"); + + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" orderBy: ").append(orderBy).append("\n"); + sb.append(" startNo: ").append(startNo).append("\n"); + sb.append(" cnt: ").append(cnt).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuOptionRes.java b/app/src/main/java/io/swagger/client/model/MenuOptionRes.java new file mode 100644 index 0000000..2599bd4 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuOptionRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.MenuOptionResData1; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuOptionRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공여부 + **/ + @ApiModelProperty(value = "성공여부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답 코드 + **/ + @ApiModelProperty(value = "응답 코드") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuOptionRes menuOptionRes = (MenuOptionRes) o; + return (responseStatus == null ? menuOptionRes.responseStatus == null : responseStatus.equals(menuOptionRes.responseStatus)) && + (responseMsg == null ? menuOptionRes.responseMsg == null : responseMsg.equals(menuOptionRes.responseMsg)) && + (data == null ? menuOptionRes.data == null : data.equals(menuOptionRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuOptionRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuOptionResData.java b/app/src/main/java/io/swagger/client/model/MenuOptionResData.java new file mode 100644 index 0000000..e499ed6 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuOptionResData.java @@ -0,0 +1,108 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuOptionResData { + + @SerializedName("id") + private String id = null; + @SerializedName("option") + private String option = null; + @SerializedName("price") + private BigDecimal price = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOption() { + return option; + } + public void setOption(String option) { + this.option = option; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getPrice() { + return price; + } + public void setPrice(BigDecimal price) { + this.price = price; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuOptionResData menuOptionResData = (MenuOptionResData) o; + return (id == null ? menuOptionResData.id == null : id.equals(menuOptionResData.id)) && + (option == null ? menuOptionResData.option == null : option.equals(menuOptionResData.option)) && + (price == null ? menuOptionResData.price == null : price.equals(menuOptionResData.price)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (id == null ? 0: id.hashCode()); + result = 31 * result + (option == null ? 0: option.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuOptionResData {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" option: ").append(option).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuOptionResData1.java b/app/src/main/java/io/swagger/client/model/MenuOptionResData1.java new file mode 100644 index 0000000..2445fd7 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuOptionResData1.java @@ -0,0 +1,263 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.MenuOptionResOptions; +import java.math.BigDecimal; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuOptionResData1 { + + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("store_id") + private String storeId = null; + @SerializedName("sub_category_id") + private String subCategoryId = null; + @SerializedName("inventory_id") + private String inventoryId = null; + @SerializedName("m_item") + private String mItem = null; + @SerializedName("m_type") + private Integer mType = null; + @SerializedName("price") + private BigDecimal price = null; + @SerializedName("points") + private Integer points = null; + @SerializedName("calory") + private Integer calory = null; + @SerializedName("barcode") + private String barcode = null; + @SerializedName("description") + private String description = null; + @SerializedName("file_id") + private String fileId = null; + @SerializedName("options") + private List options = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSubCategoryId() { + return subCategoryId; + } + public void setSubCategoryId(String subCategoryId) { + this.subCategoryId = subCategoryId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getInventoryId() { + return inventoryId; + } + public void setInventoryId(String inventoryId) { + this.inventoryId = inventoryId; + } + + /** + * 메뉴명 + **/ + @ApiModelProperty(value = "메뉴명") + public String getMItem() { + return mItem; + } + public void setMItem(String mItem) { + this.mItem = mItem; + } + + /** + * 메뉴옵션 타입 + **/ + @ApiModelProperty(value = "메뉴옵션 타입") + public Integer getMType() { + return mType; + } + public void setMType(Integer mType) { + this.mType = mType; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getPrice() { + return price; + } + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getPoints() { + return points; + } + public void setPoints(Integer points) { + this.points = points; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCalory() { + return calory; + } + public void setCalory(Integer calory) { + this.calory = calory; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getBarcode() { + return barcode; + } + public void setBarcode(String barcode) { + this.barcode = barcode; + } + + /** + * 메뉴설명 + **/ + @ApiModelProperty(value = "메뉴설명") + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getFileId() { + return fileId; + } + public void setFileId(String fileId) { + this.fileId = fileId; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getOptions() { + return options; + } + public void setOptions(List options) { + this.options = options; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuOptionResData1 menuOptionResData1 = (MenuOptionResData1) o; + return (menuId == null ? menuOptionResData1.menuId == null : menuId.equals(menuOptionResData1.menuId)) && + (storeId == null ? menuOptionResData1.storeId == null : storeId.equals(menuOptionResData1.storeId)) && + (subCategoryId == null ? menuOptionResData1.subCategoryId == null : subCategoryId.equals(menuOptionResData1.subCategoryId)) && + (inventoryId == null ? menuOptionResData1.inventoryId == null : inventoryId.equals(menuOptionResData1.inventoryId)) && + (mItem == null ? menuOptionResData1.mItem == null : mItem.equals(menuOptionResData1.mItem)) && + (mType == null ? menuOptionResData1.mType == null : mType.equals(menuOptionResData1.mType)) && + (price == null ? menuOptionResData1.price == null : price.equals(menuOptionResData1.price)) && + (points == null ? menuOptionResData1.points == null : points.equals(menuOptionResData1.points)) && + (calory == null ? menuOptionResData1.calory == null : calory.equals(menuOptionResData1.calory)) && + (barcode == null ? menuOptionResData1.barcode == null : barcode.equals(menuOptionResData1.barcode)) && + (description == null ? menuOptionResData1.description == null : description.equals(menuOptionResData1.description)) && + (fileId == null ? menuOptionResData1.fileId == null : fileId.equals(menuOptionResData1.fileId)) && + (options == null ? menuOptionResData1.options == null : options.equals(menuOptionResData1.options)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (subCategoryId == null ? 0: subCategoryId.hashCode()); + result = 31 * result + (inventoryId == null ? 0: inventoryId.hashCode()); + result = 31 * result + (mItem == null ? 0: mItem.hashCode()); + result = 31 * result + (mType == null ? 0: mType.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + result = 31 * result + (points == null ? 0: points.hashCode()); + result = 31 * result + (calory == null ? 0: calory.hashCode()); + result = 31 * result + (barcode == null ? 0: barcode.hashCode()); + result = 31 * result + (description == null ? 0: description.hashCode()); + result = 31 * result + (fileId == null ? 0: fileId.hashCode()); + result = 31 * result + (options == null ? 0: options.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuOptionResData1 {\n"); + + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" subCategoryId: ").append(subCategoryId).append("\n"); + sb.append(" inventoryId: ").append(inventoryId).append("\n"); + sb.append(" mItem: ").append(mItem).append("\n"); + sb.append(" mType: ").append(mType).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append(" points: ").append(points).append("\n"); + sb.append(" calory: ").append(calory).append("\n"); + sb.append(" barcode: ").append(barcode).append("\n"); + sb.append(" description: ").append(description).append("\n"); + sb.append(" fileId: ").append(fileId).append("\n"); + sb.append(" options: ").append(options).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuOptionResOptions.java b/app/src/main/java/io/swagger/client/model/MenuOptionResOptions.java new file mode 100644 index 0000000..434b137 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuOptionResOptions.java @@ -0,0 +1,124 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.MenuOptionResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuOptionResOptions { + + @SerializedName("category_id") + private String categoryId = null; + @SerializedName("category_name") + private String categoryName = null; + @SerializedName("option_type") + private Integer optionType = null; + @SerializedName("data") + private List data = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getCategoryId() { + return categoryId; + } + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCategoryName() { + return categoryName; + } + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOptionType() { + return optionType; + } + public void setOptionType(Integer optionType) { + this.optionType = optionType; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuOptionResOptions menuOptionResOptions = (MenuOptionResOptions) o; + return (categoryId == null ? menuOptionResOptions.categoryId == null : categoryId.equals(menuOptionResOptions.categoryId)) && + (categoryName == null ? menuOptionResOptions.categoryName == null : categoryName.equals(menuOptionResOptions.categoryName)) && + (optionType == null ? menuOptionResOptions.optionType == null : optionType.equals(menuOptionResOptions.optionType)) && + (data == null ? menuOptionResOptions.data == null : data.equals(menuOptionResOptions.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (categoryId == null ? 0: categoryId.hashCode()); + result = 31 * result + (categoryName == null ? 0: categoryName.hashCode()); + result = 31 * result + (optionType == null ? 0: optionType.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuOptionResOptions {\n"); + + sb.append(" categoryId: ").append(categoryId).append("\n"); + sb.append(" categoryName: ").append(categoryName).append("\n"); + sb.append(" optionType: ").append(optionType).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuReq.java b/app/src/main/java/io/swagger/client/model/MenuReq.java new file mode 100644 index 0000000..549eb53 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuReq.java @@ -0,0 +1,137 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuReq { + + @SerializedName("store_id") + private String storeId = null; + @SerializedName("sub_category_id") + private String subCategoryId = null; + @SerializedName("orderBy") + private String orderBy = null; + @SerializedName("startNo") + private Integer startNo = null; + @SerializedName("cnt") + private Integer cnt = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSubCategoryId() { + return subCategoryId; + } + public void setSubCategoryId(String subCategoryId) { + this.subCategoryId = subCategoryId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderBy() { + return orderBy; + } + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStartNo() { + return startNo; + } + public void setStartNo(Integer startNo) { + this.startNo = startNo; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCnt() { + return cnt; + } + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuReq menuReq = (MenuReq) o; + return (storeId == null ? menuReq.storeId == null : storeId.equals(menuReq.storeId)) && + (subCategoryId == null ? menuReq.subCategoryId == null : subCategoryId.equals(menuReq.subCategoryId)) && + (orderBy == null ? menuReq.orderBy == null : orderBy.equals(menuReq.orderBy)) && + (startNo == null ? menuReq.startNo == null : startNo.equals(menuReq.startNo)) && + (cnt == null ? menuReq.cnt == null : cnt.equals(menuReq.cnt)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (subCategoryId == null ? 0: subCategoryId.hashCode()); + result = 31 * result + (orderBy == null ? 0: orderBy.hashCode()); + result = 31 * result + (startNo == null ? 0: startNo.hashCode()); + result = 31 * result + (cnt == null ? 0: cnt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuReq {\n"); + + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" subCategoryId: ").append(subCategoryId).append("\n"); + sb.append(" orderBy: ").append(orderBy).append("\n"); + sb.append(" startNo: ").append(startNo).append("\n"); + sb.append(" cnt: ").append(cnt).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuRes.java b/app/src/main/java/io/swagger/client/model/MenuRes.java new file mode 100644 index 0000000..a1cf2e2 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.MenuResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공여부 + **/ + @ApiModelProperty(value = "성공여부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답 코드 + **/ + @ApiModelProperty(value = "응답 코드") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuRes menuRes = (MenuRes) o; + return (responseStatus == null ? menuRes.responseStatus == null : responseStatus.equals(menuRes.responseStatus)) && + (responseMsg == null ? menuRes.responseMsg == null : responseMsg.equals(menuRes.responseMsg)) && + (data == null ? menuRes.data == null : data.equals(menuRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/MenuResData.java b/app/src/main/java/io/swagger/client/model/MenuResData.java new file mode 100644 index 0000000..fd8d86e --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/MenuResData.java @@ -0,0 +1,247 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class MenuResData { + + @SerializedName("menu_id") + private String menuId = null; + @SerializedName("sub_category_id") + private String subCategoryId = null; + @SerializedName("m_item") + private String mItem = null; + @SerializedName("m_type") + private Integer mType = null; + @SerializedName("price") + private BigDecimal price = null; + @SerializedName("points") + private Integer points = null; + @SerializedName("calory") + private Integer calory = null; + @SerializedName("barcode") + private String barcode = null; + @SerializedName("use_YN") + private String useYN = null; + @SerializedName("m_regidate") + private String mRegidate = null; + @SerializedName("description") + private String description = null; + @SerializedName("file_id") + private String fileId = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMenuId() { + return menuId; + } + public void setMenuId(String menuId) { + this.menuId = menuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSubCategoryId() { + return subCategoryId; + } + public void setSubCategoryId(String subCategoryId) { + this.subCategoryId = subCategoryId; + } + + /** + * 메뉴명 + **/ + @ApiModelProperty(value = "메뉴명") + public String getMItem() { + return mItem; + } + public void setMItem(String mItem) { + this.mItem = mItem; + } + + /** + * 메뉴옵션 타입 + **/ + @ApiModelProperty(value = "메뉴옵션 타입") + public Integer getMType() { + return mType; + } + public void setMType(Integer mType) { + this.mType = mType; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getPrice() { + return price; + } + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getPoints() { + return points; + } + public void setPoints(Integer points) { + this.points = points; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCalory() { + return calory; + } + public void setCalory(Integer calory) { + this.calory = calory; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getBarcode() { + return barcode; + } + public void setBarcode(String barcode) { + this.barcode = barcode; + } + + /** + * 판매여부 + **/ + @ApiModelProperty(value = "판매여부") + public String getUseYN() { + return useYN; + } + public void setUseYN(String useYN) { + this.useYN = useYN; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getMRegidate() { + return mRegidate; + } + public void setMRegidate(String mRegidate) { + this.mRegidate = mRegidate; + } + + /** + * 메뉴설명 + **/ + @ApiModelProperty(value = "메뉴설명") + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getFileId() { + return fileId; + } + public void setFileId(String fileId) { + this.fileId = fileId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuResData menuResData = (MenuResData) o; + return (menuId == null ? menuResData.menuId == null : menuId.equals(menuResData.menuId)) && + (subCategoryId == null ? menuResData.subCategoryId == null : subCategoryId.equals(menuResData.subCategoryId)) && + (mItem == null ? menuResData.mItem == null : mItem.equals(menuResData.mItem)) && + (mType == null ? menuResData.mType == null : mType.equals(menuResData.mType)) && + (price == null ? menuResData.price == null : price.equals(menuResData.price)) && + (points == null ? menuResData.points == null : points.equals(menuResData.points)) && + (calory == null ? menuResData.calory == null : calory.equals(menuResData.calory)) && + (barcode == null ? menuResData.barcode == null : barcode.equals(menuResData.barcode)) && + (useYN == null ? menuResData.useYN == null : useYN.equals(menuResData.useYN)) && + (mRegidate == null ? menuResData.mRegidate == null : mRegidate.equals(menuResData.mRegidate)) && + (description == null ? menuResData.description == null : description.equals(menuResData.description)) && + (fileId == null ? menuResData.fileId == null : fileId.equals(menuResData.fileId)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (menuId == null ? 0: menuId.hashCode()); + result = 31 * result + (subCategoryId == null ? 0: subCategoryId.hashCode()); + result = 31 * result + (mItem == null ? 0: mItem.hashCode()); + result = 31 * result + (mType == null ? 0: mType.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + result = 31 * result + (points == null ? 0: points.hashCode()); + result = 31 * result + (calory == null ? 0: calory.hashCode()); + result = 31 * result + (barcode == null ? 0: barcode.hashCode()); + result = 31 * result + (useYN == null ? 0: useYN.hashCode()); + result = 31 * result + (mRegidate == null ? 0: mRegidate.hashCode()); + result = 31 * result + (description == null ? 0: description.hashCode()); + result = 31 * result + (fileId == null ? 0: fileId.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuResData {\n"); + + sb.append(" menuId: ").append(menuId).append("\n"); + sb.append(" subCategoryId: ").append(subCategoryId).append("\n"); + sb.append(" mItem: ").append(mItem).append("\n"); + sb.append(" mType: ").append(mType).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append(" points: ").append(points).append("\n"); + sb.append(" calory: ").append(calory).append("\n"); + sb.append(" barcode: ").append(barcode).append("\n"); + sb.append(" useYN: ").append(useYN).append("\n"); + sb.append(" mRegidate: ").append(mRegidate).append("\n"); + sb.append(" description: ").append(description).append("\n"); + sb.append(" fileId: ").append(fileId).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderCompleteReq.java b/app/src/main/java/io/swagger/client/model/OrderCompleteReq.java new file mode 100644 index 0000000..b7af5c6 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderCompleteReq.java @@ -0,0 +1,200 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderCompleteReq { + + @SerializedName("order_id") + private String orderId = null; + @SerializedName("user_id") + private String userId = null; + @SerializedName("store_id") + private String storeId = null; + @SerializedName("amount") + private String amount = null; + @SerializedName("tax") + private String tax = null; + @SerializedName("price") + private String price = null; + @SerializedName("cash") + private String cash = null; + @SerializedName("card") + private String card = null; + @SerializedName("points") + private String points = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderId() { + return orderId; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getAmount() { + return amount; + } + public void setAmount(String amount) { + this.amount = amount; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getTax() { + return tax; + } + public void setTax(String tax) { + this.tax = tax; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getPrice() { + return price; + } + public void setPrice(String price) { + this.price = price; + } + + /** + * 현금으로 계산한 가격 + **/ + @ApiModelProperty(value = "현금으로 계산한 가격") + public String getCash() { + return cash; + } + public void setCash(String cash) { + this.cash = cash; + } + + /** + * 카드로 계산한 가격 + **/ + @ApiModelProperty(value = "카드로 계산한 가격") + public String getCard() { + return card; + } + public void setCard(String card) { + this.card = card; + } + + /** + * 포인트로 계산한 가격 + **/ + @ApiModelProperty(value = "포인트로 계산한 가격") + public String getPoints() { + return points; + } + public void setPoints(String points) { + this.points = points; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCompleteReq orderCompleteReq = (OrderCompleteReq) o; + return (orderId == null ? orderCompleteReq.orderId == null : orderId.equals(orderCompleteReq.orderId)) && + (userId == null ? orderCompleteReq.userId == null : userId.equals(orderCompleteReq.userId)) && + (storeId == null ? orderCompleteReq.storeId == null : storeId.equals(orderCompleteReq.storeId)) && + (amount == null ? orderCompleteReq.amount == null : amount.equals(orderCompleteReq.amount)) && + (tax == null ? orderCompleteReq.tax == null : tax.equals(orderCompleteReq.tax)) && + (price == null ? orderCompleteReq.price == null : price.equals(orderCompleteReq.price)) && + (cash == null ? orderCompleteReq.cash == null : cash.equals(orderCompleteReq.cash)) && + (card == null ? orderCompleteReq.card == null : card.equals(orderCompleteReq.card)) && + (points == null ? orderCompleteReq.points == null : points.equals(orderCompleteReq.points)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderId == null ? 0: orderId.hashCode()); + result = 31 * result + (userId == null ? 0: userId.hashCode()); + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (amount == null ? 0: amount.hashCode()); + result = 31 * result + (tax == null ? 0: tax.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + result = 31 * result + (cash == null ? 0: cash.hashCode()); + result = 31 * result + (card == null ? 0: card.hashCode()); + result = 31 * result + (points == null ? 0: points.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCompleteReq {\n"); + + sb.append(" orderId: ").append(orderId).append("\n"); + sb.append(" userId: ").append(userId).append("\n"); + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" amount: ").append(amount).append("\n"); + sb.append(" tax: ").append(tax).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append(" cash: ").append(cash).append("\n"); + sb.append(" card: ").append(card).append("\n"); + sb.append(" points: ").append(points).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderCompleteRes.java b/app/src/main/java/io/swagger/client/model/OrderCompleteRes.java new file mode 100644 index 0000000..eed03c5 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderCompleteRes.java @@ -0,0 +1,110 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.OrderCompleteResData; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderCompleteRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private OrderCompleteResData data = null; + + /** + * 성공유부 + **/ + @ApiModelProperty(value = "성공유부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답 메시지 + **/ + @ApiModelProperty(value = "응답 메시지") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public OrderCompleteResData getData() { + return data; + } + public void setData(OrderCompleteResData data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCompleteRes orderCompleteRes = (OrderCompleteRes) o; + return (responseStatus == null ? orderCompleteRes.responseStatus == null : responseStatus.equals(orderCompleteRes.responseStatus)) && + (responseMsg == null ? orderCompleteRes.responseMsg == null : responseMsg.equals(orderCompleteRes.responseMsg)) && + (data == null ? orderCompleteRes.data == null : data.equals(orderCompleteRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCompleteRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderCompleteResData.java b/app/src/main/java/io/swagger/client/model/OrderCompleteResData.java new file mode 100644 index 0000000..9857812 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderCompleteResData.java @@ -0,0 +1,77 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderCompleteResData { + + @SerializedName("order_num") + private Integer orderNum = null; + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOrderNum() { + return orderNum; + } + public void setOrderNum(Integer orderNum) { + this.orderNum = orderNum; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderCompleteResData orderCompleteResData = (OrderCompleteResData) o; + return (orderNum == null ? orderCompleteResData.orderNum == null : orderNum.equals(orderCompleteResData.orderNum)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderNum == null ? 0: orderNum.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderCompleteResData {\n"); + + sb.append(" orderNum: ").append(orderNum).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderReq.java b/app/src/main/java/io/swagger/client/model/OrderReq.java new file mode 100644 index 0000000..132d69d --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderReq.java @@ -0,0 +1,167 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderReq { + + @SerializedName("user_id") + private String userId = null; + @SerializedName("store_id") + private String storeId = null; + @SerializedName("order_id") + private String orderId = null; + @SerializedName("orderBy") + private String orderBy = null; + @SerializedName("startNo") + private Integer startNo = null; + @SerializedName("cnt") + private Integer cnt = null; + @SerializedName("orderByWith") + private String orderByWith = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderId() { + return orderId; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderBy() { + return orderBy; + } + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStartNo() { + return startNo; + } + public void setStartNo(Integer startNo) { + this.startNo = startNo; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCnt() { + return cnt; + } + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderByWith() { + return orderByWith; + } + public void setOrderByWith(String orderByWith) { + this.orderByWith = orderByWith; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderReq orderReq = (OrderReq) o; + return (userId == null ? orderReq.userId == null : userId.equals(orderReq.userId)) && + (storeId == null ? orderReq.storeId == null : storeId.equals(orderReq.storeId)) && + (orderId == null ? orderReq.orderId == null : orderId.equals(orderReq.orderId)) && + (orderBy == null ? orderReq.orderBy == null : orderBy.equals(orderReq.orderBy)) && + (startNo == null ? orderReq.startNo == null : startNo.equals(orderReq.startNo)) && + (cnt == null ? orderReq.cnt == null : cnt.equals(orderReq.cnt)) && + (orderByWith == null ? orderReq.orderByWith == null : orderByWith.equals(orderReq.orderByWith)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (userId == null ? 0: userId.hashCode()); + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (orderId == null ? 0: orderId.hashCode()); + result = 31 * result + (orderBy == null ? 0: orderBy.hashCode()); + result = 31 * result + (startNo == null ? 0: startNo.hashCode()); + result = 31 * result + (cnt == null ? 0: cnt.hashCode()); + result = 31 * result + (orderByWith == null ? 0: orderByWith.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderReq {\n"); + + sb.append(" userId: ").append(userId).append("\n"); + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" orderId: ").append(orderId).append("\n"); + sb.append(" orderBy: ").append(orderBy).append("\n"); + sb.append(" startNo: ").append(startNo).append("\n"); + sb.append(" cnt: ").append(cnt).append("\n"); + sb.append(" orderByWith: ").append(orderByWith).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderRes.java b/app/src/main/java/io/swagger/client/model/OrderRes.java new file mode 100644 index 0000000..0d8dd90 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.OrderResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공여부 + **/ + @ApiModelProperty(value = "성공여부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 에러 코드 + **/ + @ApiModelProperty(value = "에러 코드") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderRes orderRes = (OrderRes) o; + return (responseStatus == null ? orderRes.responseStatus == null : responseStatus.equals(orderRes.responseStatus)) && + (responseMsg == null ? orderRes.responseMsg == null : responseMsg.equals(orderRes.responseMsg)) && + (data == null ? orderRes.data == null : data.equals(orderRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderResData.java b/app/src/main/java/io/swagger/client/model/OrderResData.java new file mode 100644 index 0000000..a710022 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderResData.java @@ -0,0 +1,414 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.OrderResDetail; +import java.math.BigDecimal; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderResData { + + @SerializedName("order_id") + private String orderId = null; + @SerializedName("order_num") + private Integer orderNum = null; + @SerializedName("store_id") + private String storeId = null; + @SerializedName("machine_id") + private String machineId = null; + @SerializedName("user_id") + private String userId = null; + @SerializedName("amount") + private BigDecimal amount = null; + @SerializedName("coupon") + private BigDecimal coupon = null; + @SerializedName("coupon_title") + private String couponTitle = null; + @SerializedName("discount") + private BigDecimal discount = null; + @SerializedName("discount_title") + private String discountTitle = null; + @SerializedName("price") + private BigDecimal price = null; + @SerializedName("add_points") + private Integer addPoints = null; + @SerializedName("order_status") + private Integer orderStatus = null; + @SerializedName("cook_status") + private Integer cookStatus = null; + @SerializedName("paymethod") + private String paymethod = null; + @SerializedName("user_agent") + private Integer userAgent = null; + @SerializedName("cash") + private BigDecimal cash = null; + @SerializedName("card") + private BigDecimal card = null; + @SerializedName("points") + private Integer points = null; + @SerializedName("tax") + private BigDecimal tax = null; + @SerializedName("package") + private Integer _package = null; + @SerializedName("regidate") + private String regidate = null; + @SerializedName("detail") + private List detail = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderId() { + return orderId; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOrderNum() { + return orderNum; + } + public void setOrderNum(Integer orderNum) { + this.orderNum = orderNum; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getMachineId() { + return machineId; + } + public void setMachineId(String machineId) { + this.machineId = machineId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getAmount() { + return amount; + } + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getCoupon() { + return coupon; + } + public void setCoupon(BigDecimal coupon) { + this.coupon = coupon; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCouponTitle() { + return couponTitle; + } + public void setCouponTitle(String couponTitle) { + this.couponTitle = couponTitle; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getDiscount() { + return discount; + } + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDiscountTitle() { + return discountTitle; + } + public void setDiscountTitle(String discountTitle) { + this.discountTitle = discountTitle; + } + + /** + * 결제금액 = 주문총액 - 쿠폰 - 할인 + **/ + @ApiModelProperty(value = "결제금액 = 주문총액 - 쿠폰 - 할인") + public BigDecimal getPrice() { + return price; + } + public void setPrice(BigDecimal price) { + this.price = price; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getAddPoints() { + return addPoints; + } + public void setAddPoints(Integer addPoints) { + this.addPoints = addPoints; + } + + /** + * 주문완료, 주문취소, 환불 , null + **/ + @ApiModelProperty(value = "주문완료, 주문취소, 환불 , null") + public Integer getOrderStatus() { + return orderStatus; + } + public void setOrderStatus(Integer orderStatus) { + this.orderStatus = orderStatus; + } + + /** + * 처리중, 처리완료 + **/ + @ApiModelProperty(value = "처리중, 처리완료") + public Integer getCookStatus() { + return cookStatus; + } + public void setCookStatus(Integer cookStatus) { + this.cookStatus = cookStatus; + } + + /** + * 현금,카드,포인트(1,0,0) + **/ + @ApiModelProperty(value = "현금,카드,포인트(1,0,0)") + public String getPaymethod() { + return paymethod; + } + public void setPaymethod(String paymethod) { + this.paymethod = paymethod; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getUserAgent() { + return userAgent; + } + public void setUserAgent(Integer userAgent) { + this.userAgent = userAgent; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getCash() { + return cash; + } + public void setCash(BigDecimal cash) { + this.cash = cash; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getCard() { + return card; + } + public void setCard(BigDecimal card) { + this.card = card; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getPoints() { + return points; + } + public void setPoints(Integer points) { + this.points = points; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getTax() { + return tax; + } + public void setTax(BigDecimal tax) { + this.tax = tax; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getPackage() { + return _package; + } + public void setPackage(Integer _package) { + this._package = _package; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getRegidate() { + return regidate; + } + public void setRegidate(String regidate) { + this.regidate = regidate; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getDetail() { + return detail; + } + public void setDetail(List detail) { + this.detail = detail; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderResData orderResData = (OrderResData) o; + return (orderId == null ? orderResData.orderId == null : orderId.equals(orderResData.orderId)) && + (orderNum == null ? orderResData.orderNum == null : orderNum.equals(orderResData.orderNum)) && + (storeId == null ? orderResData.storeId == null : storeId.equals(orderResData.storeId)) && + (machineId == null ? orderResData.machineId == null : machineId.equals(orderResData.machineId)) && + (userId == null ? orderResData.userId == null : userId.equals(orderResData.userId)) && + (amount == null ? orderResData.amount == null : amount.equals(orderResData.amount)) && + (coupon == null ? orderResData.coupon == null : coupon.equals(orderResData.coupon)) && + (couponTitle == null ? orderResData.couponTitle == null : couponTitle.equals(orderResData.couponTitle)) && + (discount == null ? orderResData.discount == null : discount.equals(orderResData.discount)) && + (discountTitle == null ? orderResData.discountTitle == null : discountTitle.equals(orderResData.discountTitle)) && + (price == null ? orderResData.price == null : price.equals(orderResData.price)) && + (addPoints == null ? orderResData.addPoints == null : addPoints.equals(orderResData.addPoints)) && + (orderStatus == null ? orderResData.orderStatus == null : orderStatus.equals(orderResData.orderStatus)) && + (cookStatus == null ? orderResData.cookStatus == null : cookStatus.equals(orderResData.cookStatus)) && + (paymethod == null ? orderResData.paymethod == null : paymethod.equals(orderResData.paymethod)) && + (userAgent == null ? orderResData.userAgent == null : userAgent.equals(orderResData.userAgent)) && + (cash == null ? orderResData.cash == null : cash.equals(orderResData.cash)) && + (card == null ? orderResData.card == null : card.equals(orderResData.card)) && + (points == null ? orderResData.points == null : points.equals(orderResData.points)) && + (tax == null ? orderResData.tax == null : tax.equals(orderResData.tax)) && + (_package == null ? orderResData._package == null : _package.equals(orderResData._package)) && + (regidate == null ? orderResData.regidate == null : regidate.equals(orderResData.regidate)) && + (detail == null ? orderResData.detail == null : detail.equals(orderResData.detail)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderId == null ? 0: orderId.hashCode()); + result = 31 * result + (orderNum == null ? 0: orderNum.hashCode()); + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (machineId == null ? 0: machineId.hashCode()); + result = 31 * result + (userId == null ? 0: userId.hashCode()); + result = 31 * result + (amount == null ? 0: amount.hashCode()); + result = 31 * result + (coupon == null ? 0: coupon.hashCode()); + result = 31 * result + (couponTitle == null ? 0: couponTitle.hashCode()); + result = 31 * result + (discount == null ? 0: discount.hashCode()); + result = 31 * result + (discountTitle == null ? 0: discountTitle.hashCode()); + result = 31 * result + (price == null ? 0: price.hashCode()); + result = 31 * result + (addPoints == null ? 0: addPoints.hashCode()); + result = 31 * result + (orderStatus == null ? 0: orderStatus.hashCode()); + result = 31 * result + (cookStatus == null ? 0: cookStatus.hashCode()); + result = 31 * result + (paymethod == null ? 0: paymethod.hashCode()); + result = 31 * result + (userAgent == null ? 0: userAgent.hashCode()); + result = 31 * result + (cash == null ? 0: cash.hashCode()); + result = 31 * result + (card == null ? 0: card.hashCode()); + result = 31 * result + (points == null ? 0: points.hashCode()); + result = 31 * result + (tax == null ? 0: tax.hashCode()); + result = 31 * result + (_package == null ? 0: _package.hashCode()); + result = 31 * result + (regidate == null ? 0: regidate.hashCode()); + result = 31 * result + (detail == null ? 0: detail.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderResData {\n"); + + sb.append(" orderId: ").append(orderId).append("\n"); + sb.append(" orderNum: ").append(orderNum).append("\n"); + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" machineId: ").append(machineId).append("\n"); + sb.append(" userId: ").append(userId).append("\n"); + sb.append(" amount: ").append(amount).append("\n"); + sb.append(" coupon: ").append(coupon).append("\n"); + sb.append(" couponTitle: ").append(couponTitle).append("\n"); + sb.append(" discount: ").append(discount).append("\n"); + sb.append(" discountTitle: ").append(discountTitle).append("\n"); + sb.append(" price: ").append(price).append("\n"); + sb.append(" addPoints: ").append(addPoints).append("\n"); + sb.append(" orderStatus: ").append(orderStatus).append("\n"); + sb.append(" cookStatus: ").append(cookStatus).append("\n"); + sb.append(" paymethod: ").append(paymethod).append("\n"); + sb.append(" userAgent: ").append(userAgent).append("\n"); + sb.append(" cash: ").append(cash).append("\n"); + sb.append(" card: ").append(card).append("\n"); + sb.append(" points: ").append(points).append("\n"); + sb.append(" tax: ").append(tax).append("\n"); + sb.append(" _package: ").append(_package).append("\n"); + sb.append(" regidate: ").append(regidate).append("\n"); + sb.append(" detail: ").append(detail).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderResDetail.java b/app/src/main/java/io/swagger/client/model/OrderResDetail.java new file mode 100644 index 0000000..62561c9 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderResDetail.java @@ -0,0 +1,215 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.OrderResOption; +import java.math.BigDecimal; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderResDetail { + + @SerializedName("order_detail_id") + private String orderDetailId = null; + @SerializedName("detail_menu_id") + private String detailMenuId = null; + @SerializedName("detail_quantity") + private Integer detailQuantity = null; + @SerializedName("detail_file_id") + private String detailFileId = null; + @SerializedName("detail_menu_name") + private String detailMenuName = null; + @SerializedName("detail_price") + private BigDecimal detailPrice = null; + @SerializedName("detail_calory") + private Integer detailCalory = null; + @SerializedName("detail_points") + private Integer detailPoints = null; + @SerializedName("detail_description") + private String detailDescription = null; + @SerializedName("option") + private List option = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderDetailId() { + return orderDetailId; + } + public void setOrderDetailId(String orderDetailId) { + this.orderDetailId = orderDetailId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDetailMenuId() { + return detailMenuId; + } + public void setDetailMenuId(String detailMenuId) { + this.detailMenuId = detailMenuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getDetailQuantity() { + return detailQuantity; + } + public void setDetailQuantity(Integer detailQuantity) { + this.detailQuantity = detailQuantity; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDetailFileId() { + return detailFileId; + } + public void setDetailFileId(String detailFileId) { + this.detailFileId = detailFileId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDetailMenuName() { + return detailMenuName; + } + public void setDetailMenuName(String detailMenuName) { + this.detailMenuName = detailMenuName; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getDetailPrice() { + return detailPrice; + } + public void setDetailPrice(BigDecimal detailPrice) { + this.detailPrice = detailPrice; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getDetailCalory() { + return detailCalory; + } + public void setDetailCalory(Integer detailCalory) { + this.detailCalory = detailCalory; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getDetailPoints() { + return detailPoints; + } + public void setDetailPoints(Integer detailPoints) { + this.detailPoints = detailPoints; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDetailDescription() { + return detailDescription; + } + public void setDetailDescription(String detailDescription) { + this.detailDescription = detailDescription; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getOption() { + return option; + } + public void setOption(List option) { + this.option = option; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderResDetail orderResDetail = (OrderResDetail) o; + return (orderDetailId == null ? orderResDetail.orderDetailId == null : orderDetailId.equals(orderResDetail.orderDetailId)) && + (detailMenuId == null ? orderResDetail.detailMenuId == null : detailMenuId.equals(orderResDetail.detailMenuId)) && + (detailQuantity == null ? orderResDetail.detailQuantity == null : detailQuantity.equals(orderResDetail.detailQuantity)) && + (detailFileId == null ? orderResDetail.detailFileId == null : detailFileId.equals(orderResDetail.detailFileId)) && + (detailMenuName == null ? orderResDetail.detailMenuName == null : detailMenuName.equals(orderResDetail.detailMenuName)) && + (detailPrice == null ? orderResDetail.detailPrice == null : detailPrice.equals(orderResDetail.detailPrice)) && + (detailCalory == null ? orderResDetail.detailCalory == null : detailCalory.equals(orderResDetail.detailCalory)) && + (detailPoints == null ? orderResDetail.detailPoints == null : detailPoints.equals(orderResDetail.detailPoints)) && + (detailDescription == null ? orderResDetail.detailDescription == null : detailDescription.equals(orderResDetail.detailDescription)) && + (option == null ? orderResDetail.option == null : option.equals(orderResDetail.option)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderDetailId == null ? 0: orderDetailId.hashCode()); + result = 31 * result + (detailMenuId == null ? 0: detailMenuId.hashCode()); + result = 31 * result + (detailQuantity == null ? 0: detailQuantity.hashCode()); + result = 31 * result + (detailFileId == null ? 0: detailFileId.hashCode()); + result = 31 * result + (detailMenuName == null ? 0: detailMenuName.hashCode()); + result = 31 * result + (detailPrice == null ? 0: detailPrice.hashCode()); + result = 31 * result + (detailCalory == null ? 0: detailCalory.hashCode()); + result = 31 * result + (detailPoints == null ? 0: detailPoints.hashCode()); + result = 31 * result + (detailDescription == null ? 0: detailDescription.hashCode()); + result = 31 * result + (option == null ? 0: option.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderResDetail {\n"); + + sb.append(" orderDetailId: ").append(orderDetailId).append("\n"); + sb.append(" detailMenuId: ").append(detailMenuId).append("\n"); + sb.append(" detailQuantity: ").append(detailQuantity).append("\n"); + sb.append(" detailFileId: ").append(detailFileId).append("\n"); + sb.append(" detailMenuName: ").append(detailMenuName).append("\n"); + sb.append(" detailPrice: ").append(detailPrice).append("\n"); + sb.append(" detailCalory: ").append(detailCalory).append("\n"); + sb.append(" detailPoints: ").append(detailPoints).append("\n"); + sb.append(" detailDescription: ").append(detailDescription).append("\n"); + sb.append(" option: ").append(option).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/OrderResOption.java b/app/src/main/java/io/swagger/client/model/OrderResOption.java new file mode 100644 index 0000000..61af4ea --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/OrderResOption.java @@ -0,0 +1,213 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class OrderResOption { + + @SerializedName("order_option_id") + private String orderOptionId = null; + @SerializedName("option_menu_id") + private String optionMenuId = null; + @SerializedName("option_quantity") + private Integer optionQuantity = null; + @SerializedName("option_file_id") + private String optionFileId = null; + @SerializedName("option_menu_name") + private String optionMenuName = null; + @SerializedName("option_price") + private BigDecimal optionPrice = null; + @SerializedName("option_calory") + private Integer optionCalory = null; + @SerializedName("option_points") + private Integer optionPoints = null; + @SerializedName("option_op") + private Integer optionOp = null; + @SerializedName("option_description") + private String optionDescription = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderOptionId() { + return orderOptionId; + } + public void setOrderOptionId(String orderOptionId) { + this.orderOptionId = orderOptionId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOptionMenuId() { + return optionMenuId; + } + public void setOptionMenuId(String optionMenuId) { + this.optionMenuId = optionMenuId; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOptionQuantity() { + return optionQuantity; + } + public void setOptionQuantity(Integer optionQuantity) { + this.optionQuantity = optionQuantity; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOptionFileId() { + return optionFileId; + } + public void setOptionFileId(String optionFileId) { + this.optionFileId = optionFileId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOptionMenuName() { + return optionMenuName; + } + public void setOptionMenuName(String optionMenuName) { + this.optionMenuName = optionMenuName; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getOptionPrice() { + return optionPrice; + } + public void setOptionPrice(BigDecimal optionPrice) { + this.optionPrice = optionPrice; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOptionCalory() { + return optionCalory; + } + public void setOptionCalory(Integer optionCalory) { + this.optionCalory = optionCalory; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOptionPoints() { + return optionPoints; + } + public void setOptionPoints(Integer optionPoints) { + this.optionPoints = optionPoints; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getOptionOp() { + return optionOp; + } + public void setOptionOp(Integer optionOp) { + this.optionOp = optionOp; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOptionDescription() { + return optionDescription; + } + public void setOptionDescription(String optionDescription) { + this.optionDescription = optionDescription; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderResOption orderResOption = (OrderResOption) o; + return (orderOptionId == null ? orderResOption.orderOptionId == null : orderOptionId.equals(orderResOption.orderOptionId)) && + (optionMenuId == null ? orderResOption.optionMenuId == null : optionMenuId.equals(orderResOption.optionMenuId)) && + (optionQuantity == null ? orderResOption.optionQuantity == null : optionQuantity.equals(orderResOption.optionQuantity)) && + (optionFileId == null ? orderResOption.optionFileId == null : optionFileId.equals(orderResOption.optionFileId)) && + (optionMenuName == null ? orderResOption.optionMenuName == null : optionMenuName.equals(orderResOption.optionMenuName)) && + (optionPrice == null ? orderResOption.optionPrice == null : optionPrice.equals(orderResOption.optionPrice)) && + (optionCalory == null ? orderResOption.optionCalory == null : optionCalory.equals(orderResOption.optionCalory)) && + (optionPoints == null ? orderResOption.optionPoints == null : optionPoints.equals(orderResOption.optionPoints)) && + (optionOp == null ? orderResOption.optionOp == null : optionOp.equals(orderResOption.optionOp)) && + (optionDescription == null ? orderResOption.optionDescription == null : optionDescription.equals(orderResOption.optionDescription)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (orderOptionId == null ? 0: orderOptionId.hashCode()); + result = 31 * result + (optionMenuId == null ? 0: optionMenuId.hashCode()); + result = 31 * result + (optionQuantity == null ? 0: optionQuantity.hashCode()); + result = 31 * result + (optionFileId == null ? 0: optionFileId.hashCode()); + result = 31 * result + (optionMenuName == null ? 0: optionMenuName.hashCode()); + result = 31 * result + (optionPrice == null ? 0: optionPrice.hashCode()); + result = 31 * result + (optionCalory == null ? 0: optionCalory.hashCode()); + result = 31 * result + (optionPoints == null ? 0: optionPoints.hashCode()); + result = 31 * result + (optionOp == null ? 0: optionOp.hashCode()); + result = 31 * result + (optionDescription == null ? 0: optionDescription.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderResOption {\n"); + + sb.append(" orderOptionId: ").append(orderOptionId).append("\n"); + sb.append(" optionMenuId: ").append(optionMenuId).append("\n"); + sb.append(" optionQuantity: ").append(optionQuantity).append("\n"); + sb.append(" optionFileId: ").append(optionFileId).append("\n"); + sb.append(" optionMenuName: ").append(optionMenuName).append("\n"); + sb.append(" optionPrice: ").append(optionPrice).append("\n"); + sb.append(" optionCalory: ").append(optionCalory).append("\n"); + sb.append(" optionPoints: ").append(optionPoints).append("\n"); + sb.append(" optionOp: ").append(optionOp).append("\n"); + sb.append(" optionDescription: ").append(optionDescription).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/StoresReq.java b/app/src/main/java/io/swagger/client/model/StoresReq.java new file mode 100644 index 0000000..a963b72 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/StoresReq.java @@ -0,0 +1,122 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class StoresReq { + + @SerializedName("account_id") + private String accountId = null; + @SerializedName("orderBy") + private String orderBy = null; + @SerializedName("startNo") + private Integer startNo = null; + @SerializedName("cnt") + private Integer cnt = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getAccountId() { + return accountId; + } + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderBy() { + return orderBy; + } + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStartNo() { + return startNo; + } + public void setStartNo(Integer startNo) { + this.startNo = startNo; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCnt() { + return cnt; + } + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoresReq storesReq = (StoresReq) o; + return (accountId == null ? storesReq.accountId == null : accountId.equals(storesReq.accountId)) && + (orderBy == null ? storesReq.orderBy == null : orderBy.equals(storesReq.orderBy)) && + (startNo == null ? storesReq.startNo == null : startNo.equals(storesReq.startNo)) && + (cnt == null ? storesReq.cnt == null : cnt.equals(storesReq.cnt)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (accountId == null ? 0: accountId.hashCode()); + result = 31 * result + (orderBy == null ? 0: orderBy.hashCode()); + result = 31 * result + (startNo == null ? 0: startNo.hashCode()); + result = 31 * result + (cnt == null ? 0: cnt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoresReq {\n"); + + sb.append(" accountId: ").append(accountId).append("\n"); + sb.append(" orderBy: ").append(orderBy).append("\n"); + sb.append(" startNo: ").append(startNo).append("\n"); + sb.append(" cnt: ").append(cnt).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/StoresRes.java b/app/src/main/java/io/swagger/client/model/StoresRes.java new file mode 100644 index 0000000..5005d15 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/StoresRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.StoresResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class StoresRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공여부 + **/ + @ApiModelProperty(value = "성공여부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 에러 코드 + **/ + @ApiModelProperty(value = "에러 코드") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoresRes storesRes = (StoresRes) o; + return (responseStatus == null ? storesRes.responseStatus == null : responseStatus.equals(storesRes.responseStatus)) && + (responseMsg == null ? storesRes.responseMsg == null : responseMsg.equals(storesRes.responseMsg)) && + (data == null ? storesRes.data == null : data.equals(storesRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoresRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/StoresResData.java b/app/src/main/java/io/swagger/client/model/StoresResData.java new file mode 100644 index 0000000..f4b37f7 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/StoresResData.java @@ -0,0 +1,216 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import java.math.BigDecimal; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class StoresResData { + + @SerializedName("store_id") + private String storeId = null; + @SerializedName("user_id") + private String userId = null; + @SerializedName("store") + private String store = null; + @SerializedName("u_points") + private Integer uPoints = null; + @SerializedName("u_status") + private Integer uStatus = null; + @SerializedName("u_level") + private String uLevel = null; + @SerializedName("s_address") + private String sAddress = null; + @SerializedName("s_logo") + private String sLogo = null; + @SerializedName("s_tax") + private BigDecimal sTax = null; + @SerializedName("s_phone") + private String sPhone = null; + + /** + * 매장번호 + **/ + @ApiModelProperty(value = "매장번호") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + /** + * 회사명 + **/ + @ApiModelProperty(value = "회사명") + public String getStore() { + return store; + } + public void setStore(String store) { + this.store = store; + } + + /** + * 스토어별 point + **/ + @ApiModelProperty(value = "스토어별 point") + public Integer getUPoints() { + return uPoints; + } + public void setUPoints(Integer uPoints) { + this.uPoints = uPoints; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getUStatus() { + return uStatus; + } + public void setUStatus(Integer uStatus) { + this.uStatus = uStatus; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getULevel() { + return uLevel; + } + public void setULevel(String uLevel) { + this.uLevel = uLevel; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSAddress() { + return sAddress; + } + public void setSAddress(String sAddress) { + this.sAddress = sAddress; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSLogo() { + return sLogo; + } + public void setSLogo(String sLogo) { + this.sLogo = sLogo; + } + + /** + **/ + @ApiModelProperty(value = "") + public BigDecimal getSTax() { + return sTax; + } + public void setSTax(BigDecimal sTax) { + this.sTax = sTax; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSPhone() { + return sPhone; + } + public void setSPhone(String sPhone) { + this.sPhone = sPhone; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoresResData storesResData = (StoresResData) o; + return (storeId == null ? storesResData.storeId == null : storeId.equals(storesResData.storeId)) && + (userId == null ? storesResData.userId == null : userId.equals(storesResData.userId)) && + (store == null ? storesResData.store == null : store.equals(storesResData.store)) && + (uPoints == null ? storesResData.uPoints == null : uPoints.equals(storesResData.uPoints)) && + (uStatus == null ? storesResData.uStatus == null : uStatus.equals(storesResData.uStatus)) && + (uLevel == null ? storesResData.uLevel == null : uLevel.equals(storesResData.uLevel)) && + (sAddress == null ? storesResData.sAddress == null : sAddress.equals(storesResData.sAddress)) && + (sLogo == null ? storesResData.sLogo == null : sLogo.equals(storesResData.sLogo)) && + (sTax == null ? storesResData.sTax == null : sTax.equals(storesResData.sTax)) && + (sPhone == null ? storesResData.sPhone == null : sPhone.equals(storesResData.sPhone)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (userId == null ? 0: userId.hashCode()); + result = 31 * result + (store == null ? 0: store.hashCode()); + result = 31 * result + (uPoints == null ? 0: uPoints.hashCode()); + result = 31 * result + (uStatus == null ? 0: uStatus.hashCode()); + result = 31 * result + (uLevel == null ? 0: uLevel.hashCode()); + result = 31 * result + (sAddress == null ? 0: sAddress.hashCode()); + result = 31 * result + (sLogo == null ? 0: sLogo.hashCode()); + result = 31 * result + (sTax == null ? 0: sTax.hashCode()); + result = 31 * result + (sPhone == null ? 0: sPhone.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoresResData {\n"); + + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" userId: ").append(userId).append("\n"); + sb.append(" store: ").append(store).append("\n"); + sb.append(" uPoints: ").append(uPoints).append("\n"); + sb.append(" uStatus: ").append(uStatus).append("\n"); + sb.append(" uLevel: ").append(uLevel).append("\n"); + sb.append(" sAddress: ").append(sAddress).append("\n"); + sb.append(" sLogo: ").append(sLogo).append("\n"); + sb.append(" sTax: ").append(sTax).append("\n"); + sb.append(" sPhone: ").append(sPhone).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/SubcategoryReq.java b/app/src/main/java/io/swagger/client/model/SubcategoryReq.java new file mode 100644 index 0000000..1985d9e --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/SubcategoryReq.java @@ -0,0 +1,122 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class SubcategoryReq { + + @SerializedName("store_id") + private String storeId = null; + @SerializedName("orderBy") + private String orderBy = null; + @SerializedName("startNo") + private Integer startNo = null; + @SerializedName("cnt") + private Integer cnt = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getStoreId() { + return storeId; + } + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOrderBy() { + return orderBy; + } + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getStartNo() { + return startNo; + } + public void setStartNo(Integer startNo) { + this.startNo = startNo; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCnt() { + return cnt; + } + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubcategoryReq subcategoryReq = (SubcategoryReq) o; + return (storeId == null ? subcategoryReq.storeId == null : storeId.equals(subcategoryReq.storeId)) && + (orderBy == null ? subcategoryReq.orderBy == null : orderBy.equals(subcategoryReq.orderBy)) && + (startNo == null ? subcategoryReq.startNo == null : startNo.equals(subcategoryReq.startNo)) && + (cnt == null ? subcategoryReq.cnt == null : cnt.equals(subcategoryReq.cnt)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (storeId == null ? 0: storeId.hashCode()); + result = 31 * result + (orderBy == null ? 0: orderBy.hashCode()); + result = 31 * result + (startNo == null ? 0: startNo.hashCode()); + result = 31 * result + (cnt == null ? 0: cnt.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubcategoryReq {\n"); + + sb.append(" storeId: ").append(storeId).append("\n"); + sb.append(" orderBy: ").append(orderBy).append("\n"); + sb.append(" startNo: ").append(startNo).append("\n"); + sb.append(" cnt: ").append(cnt).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/SubcategoryRes.java b/app/src/main/java/io/swagger/client/model/SubcategoryRes.java new file mode 100644 index 0000000..dc2d55d --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/SubcategoryRes.java @@ -0,0 +1,111 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + +import io.swagger.client.model.SubcategoryResData; +import java.util.*; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class SubcategoryRes { + + @SerializedName("responseStatus") + private Integer responseStatus = null; + @SerializedName("responseMsg") + private String responseMsg = null; + @SerializedName("data") + private List data = null; + + /** + * 성공여부 + **/ + @ApiModelProperty(value = "성공여부") + public Integer getResponseStatus() { + return responseStatus; + } + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + /** + * 응답 코드 + **/ + @ApiModelProperty(value = "응답 코드") + public String getResponseMsg() { + return responseMsg; + } + public void setResponseMsg(String responseMsg) { + this.responseMsg = responseMsg; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getData() { + return data; + } + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubcategoryRes subcategoryRes = (SubcategoryRes) o; + return (responseStatus == null ? subcategoryRes.responseStatus == null : responseStatus.equals(subcategoryRes.responseStatus)) && + (responseMsg == null ? subcategoryRes.responseMsg == null : responseMsg.equals(subcategoryRes.responseMsg)) && + (data == null ? subcategoryRes.data == null : data.equals(subcategoryRes.data)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (responseStatus == null ? 0: responseStatus.hashCode()); + result = 31 * result + (responseMsg == null ? 0: responseMsg.hashCode()); + result = 31 * result + (data == null ? 0: data.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubcategoryRes {\n"); + + sb.append(" responseStatus: ").append(responseStatus).append("\n"); + sb.append(" responseMsg: ").append(responseMsg).append("\n"); + sb.append(" data: ").append(data).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/model/SubcategoryResData.java b/app/src/main/java/io/swagger/client/model/SubcategoryResData.java new file mode 100644 index 0000000..977f587 --- /dev/null +++ b/app/src/main/java/io/swagger/client/model/SubcategoryResData.java @@ -0,0 +1,107 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class SubcategoryResData { + + @SerializedName("sub_category_id") + private String subCategoryId = null; + @SerializedName("sub_category_name") + private String subCategoryName = null; + @SerializedName("file_id") + private String fileId = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getSubCategoryId() { + return subCategoryId; + } + public void setSubCategoryId(String subCategoryId) { + this.subCategoryId = subCategoryId; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSubCategoryName() { + return subCategoryName; + } + public void setSubCategoryName(String subCategoryName) { + this.subCategoryName = subCategoryName; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getFileId() { + return fileId; + } + public void setFileId(String fileId) { + this.fileId = fileId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubcategoryResData subcategoryResData = (SubcategoryResData) o; + return (subCategoryId == null ? subcategoryResData.subCategoryId == null : subCategoryId.equals(subcategoryResData.subCategoryId)) && + (subCategoryName == null ? subcategoryResData.subCategoryName == null : subCategoryName.equals(subcategoryResData.subCategoryName)) && + (fileId == null ? subcategoryResData.fileId == null : fileId.equals(subcategoryResData.fileId)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (subCategoryId == null ? 0: subCategoryId.hashCode()); + result = 31 * result + (subCategoryName == null ? 0: subCategoryName.hashCode()); + result = 31 * result + (fileId == null ? 0: fileId.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubcategoryResData {\n"); + + sb.append(" subCategoryId: ").append(subCategoryId).append("\n"); + sb.append(" subCategoryName: ").append(subCategoryName).append("\n"); + sb.append(" fileId: ").append(fileId).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/io/swagger/client/request/DeleteRequest.java b/app/src/main/java/io/swagger/client/request/DeleteRequest.java new file mode 100644 index 0000000..d45386c --- /dev/null +++ b/app/src/main/java/io/swagger/client/request/DeleteRequest.java @@ -0,0 +1,116 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class DeleteRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public DeleteRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.DELETE, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/app/src/main/java/io/swagger/client/request/GetRequest.java b/app/src/main/java/io/swagger/client/request/GetRequest.java new file mode 100644 index 0000000..b5be7ac --- /dev/null +++ b/app/src/main/java/io/swagger/client/request/GetRequest.java @@ -0,0 +1,63 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.Response; +import com.android.volley.toolbox.StringRequest; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class GetRequest extends StringRequest{ + Map apiHeaders; + String contentType; + + public GetRequest(String url, Map apiHeaders, String contentType, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.GET, url, listener, errorListener); + this.apiHeaders = apiHeaders; + this.contentType = contentType; + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/app/src/main/java/io/swagger/client/request/PatchRequest.java b/app/src/main/java/io/swagger/client/request/PatchRequest.java new file mode 100644 index 0000000..9a736ed --- /dev/null +++ b/app/src/main/java/io/swagger/client/request/PatchRequest.java @@ -0,0 +1,116 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PatchRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PatchRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.PATCH, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/app/src/main/java/io/swagger/client/request/PostRequest.java b/app/src/main/java/io/swagger/client/request/PostRequest.java new file mode 100644 index 0000000..a8519d0 --- /dev/null +++ b/app/src/main/java/io/swagger/client/request/PostRequest.java @@ -0,0 +1,116 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PostRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PostRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.POST, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/app/src/main/java/io/swagger/client/request/PutRequest.java b/app/src/main/java/io/swagger/client/request/PutRequest.java new file mode 100644 index 0000000..59deeea --- /dev/null +++ b/app/src/main/java/io/swagger/client/request/PutRequest.java @@ -0,0 +1,116 @@ +/** + * Kiosk API + * + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.swagger.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PutRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PutRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.PUT, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/ApplicationLoader.java b/app/src/main/java/net/bluehack/kiosk/ApplicationLoader.java index fa0fda6..2140831 100644 --- a/app/src/main/java/net/bluehack/kiosk/ApplicationLoader.java +++ b/app/src/main/java/net/bluehack/kiosk/ApplicationLoader.java @@ -1,26 +1,72 @@ package net.bluehack.kiosk; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + import android.app.Application; import android.content.Context; -import static net.bluehack.kiosk.util.Logger.makeLogTag; +import com.crashlytics.android.Crashlytics; +import com.google.android.gms.analytics.GoogleAnalytics; +import com.google.android.gms.analytics.Tracker; +import com.google.firebase.analytics.FirebaseAnalytics; +import com.tsengvn.typekit.Typekit; + +import io.fabric.sdk.android.Fabric; + +import net.bluehack.kiosk.util.KioskPreference; public class ApplicationLoader extends Application { private static String TAG = makeLogTag(ApplicationLoader.class); - private static Context instance; + private static volatile Context instance; + private static FirebaseAnalytics firebaseAnalytics; + private static GoogleAnalytics gaAnalytics; + private static Tracker gaTracker; @Override public void onCreate() { super.onCreate(); - instance = this; + instance = getApplicationContext(); + KioskPreference.getInstance().init(instance); + + Fabric.with(this, new Crashlytics()); + Typekit.getInstance() + .addCustom1(Typekit.createFromAsset(this, "Roboto-Black.ttf")); } public static Context getContext() { return instance.getApplicationContext(); } + public static synchronized FirebaseAnalytics getFirebaseAnalytics() { + if (firebaseAnalytics == null) { + firebaseAnalytics = FirebaseAnalytics.getInstance(instance); + firebaseAnalytics.setUserId(getUserId()); + } + return firebaseAnalytics; + } + + public static synchronized Tracker getGaTracker() { + + if (gaTracker == null) { + gaAnalytics = GoogleAnalytics.getInstance(instance); + gaTracker = gaAnalytics.newTracker(R.xml.global_tracker); + gaTracker.enableAutoActivityTracking(true); + gaTracker.enableExceptionReporting(true); + //gaTracker.enableAdvertisingIdCollection(true); + } + return gaTracker; + } + + public static String getUserId() { + String user_id = "init_id"; + if (KioskPreference.getInstance().getLoginInfo() != null) { + user_id = KioskPreference.getInstance().getLoginInfo().getAccountId(); + } + return user_id; + } + } diff --git a/app/src/main/java/net/bluehack/kiosk/BaseActivity.java b/app/src/main/java/net/bluehack/kiosk/BaseActivity.java new file mode 100644 index 0000000..b6c0c79 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/BaseActivity.java @@ -0,0 +1,16 @@ +package net.bluehack.kiosk; + +import android.content.Context; +import android.support.v7.app.AppCompatActivity; + +import com.tsengvn.typekit.TypekitContextWrapper; + +public class BaseActivity extends AppCompatActivity { + + @Override + protected void attachBaseContext(Context newBase) { + + super.attachBaseContext(TypekitContextWrapper.wrap(newBase)); + + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/api/ApiClient.java b/app/src/main/java/net/bluehack/kiosk/api/ApiClient.java deleted file mode 100644 index cc4da7a..0000000 --- a/app/src/main/java/net/bluehack/kiosk/api/ApiClient.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.bluehack.kiosk.api; - -import android.os.AsyncTask; -import android.util.Log; - -import com.amazonaws.mobileconnectors.apigateway.ApiClientFactory; - -import net.bluehack.kiosk.KioskAPIClient; -import net.bluehack.kiosk.model.Menu; - -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class ApiClient { - private static final String TAG = makeLogTag(ApiClient.class); - private static ApiClient ourInstance = new ApiClient(); - private final ApiClientFactory factory; - private final KioskAPIClient client; - - public static ApiClient getInstance() { - return ourInstance; - } - - private ApiClient() { - factory = new ApiClientFactory(); - client = factory.build(KioskAPIClient.class); - } - - public interface ApiResponseListener { - void onResponse(Object result); - } - - public KioskAPIClient getClient() { - return client; - } - - public void menuGet(final String query, final ApiResponseListener listener) { - new AsyncTask() { - @Override - protected Void doInBackground(Void... params) { - - Menu output = null; - - output = client.menuGet(query); - Log.e("menuGet:", String.valueOf(output)); - - listener.onResponse(output); - - return null; - } - - }.execute(); - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/api/net/NetworkChangeReceiver.java b/app/src/main/java/net/bluehack/kiosk/api/net/NetworkChangeReceiver.java new file mode 100644 index 0000000..5fc519c --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/api/net/NetworkChangeReceiver.java @@ -0,0 +1,17 @@ +package net.bluehack.kiosk.api.net; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.widget.Toast; + +public class NetworkChangeReceiver extends BroadcastReceiver { + + @Override + public void onReceive(final Context context, final Intent intent) { + + String status = NetworkManager.getConnectivityStatusString(context); + + Toast.makeText(context, status, Toast.LENGTH_LONG).show(); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/api/net/NetworkManager.java b/app/src/main/java/net/bluehack/kiosk/api/net/NetworkManager.java new file mode 100644 index 0000000..c2f7c0a --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/api/net/NetworkManager.java @@ -0,0 +1,147 @@ +package net.bluehack.kiosk.api.net; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.app.Activity; +import android.content.Context; +import android.content.res.Resources; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.UiUtil; + +public class NetworkManager { + + private static final String TAG = makeLogTag(NetworkManager.class); + private static NetworkManager ourInstance = new NetworkManager(); + public static int TYPE_WIFI = 1; + public static int TYPE_MOBILE = 2; + public static int TYPE_NOT_CONNECTED = 0; + + public static NetworkManager getInstance() { + return ourInstance; + } + + private NetworkManager() { + } + + public static boolean isNetworkOnline() { + try { + ConnectivityManager cm = (ConnectivityManager) ApplicationLoader.getContext() + .getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo netInfo = cm.getActiveNetworkInfo(); + if (netInfo != null && (netInfo.isConnectedOrConnecting() || netInfo.isAvailable())) { + return true; + } + + netInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); + + if (netInfo != null && netInfo.isConnectedOrConnecting()) { + return true; + } else { + netInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); + if (netInfo != null && netInfo.isConnectedOrConnecting()) { + return true; + } + } + } catch (Exception e) { + LOGE(TAG, String.valueOf(e)); + return true; + } + return false; + } + + public static String getConnectivityStatusString(Context context) { + int conn = NetworkManager.getConnectivityStatus(context); + String status = null; + + if (conn == NetworkManager.TYPE_NOT_CONNECTED) { + status = context.getResources().getString(R.string.network_status); + } + /*if (conn == NetworkManager.TYPE_WIFI) { + status = "Wifi enabled"; + } else if (conn == NetworkManager.TYPE_MOBILE) { + status = "Mobile data enabled"; + } else if (conn == NetworkManager.TYPE_NOT_CONNECTED) { + status = context.getResources().getString(R.string.network_status); + }*/ + return status; + } + + public static int getConnectivityStatus(Context context) { + ConnectivityManager cm = (ConnectivityManager) context + .getSystemService(Context.CONNECTIVITY_SERVICE); + + NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); + if (null != activeNetwork) { + if(activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) + return TYPE_WIFI; + + if(activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) + return TYPE_MOBILE; + } + return TYPE_NOT_CONNECTED; + } + + public static void showServerErrorPopup(final Context context) { + + new Thread(new Runnable() { + @Override + public void run() { + new Handler(Looper.getMainLooper()).post(new Runnable() { + @Override + public void run() { + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + FrameLayout flLine = (FrameLayout) popup.getContentView().findViewById(R.id.flLine); + + ivImage.setVisibility(View.GONE); + flLine.setVisibility(View.VISIBLE); + + tvLeftButton.setText(context.getResources().getString(R.string.popup_server_error_left_btn)); + tvTitle.setText(context.getResources().getString(R.string.popup_server_error_title)); + tvMessage.setText(context.getResources().getString(R.string.popup_server_error_message)); + tvSubMessage.setText(context.getResources().getString(R.string.popup_server_error_sub)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_server_error_title)); + + tvRightButton.setVisibility(View.GONE); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_server_error_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + } + }); + } + }); + } + }).start(); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/cart/CartMenuActivity.java b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuActivity.java new file mode 100644 index 0000000..c39665d --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuActivity.java @@ -0,0 +1,201 @@ +package net.bluehack.kiosk.cart; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; +import com.google.gson.Gson; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.payment.PaymentActivity; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderReqDetail; +import io.swagger.client.model.AddOrderReqOption; +import io.swagger.client.model.AddOrderRes; + +public class CartMenuActivity extends BaseActivity { + + private static final String TAG = makeLogTag(CartMenuActivity.class); + private Context context; + private CartMenuAdapter cartMenuAdapter; + private RecyclerView.LayoutManager layoutManager; + private RecyclerView cart_menu_rv_list; + private TextView cart_menu_tv_point; + private TextView cart_menu_tv_payment_count; + private TextView cart_menu_tv_payment_price; + private ImageView cart_menu_btn_payment; + private View cart_empty_layout; + private View cart_menu_layout; + private LinearLayout cart_menu_ll_bottom; + + private LinearLayout progress_ll; + private ImageView progress_iv; + private ArrayList getCartMenuList = null; + private double total = 0.00; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_cart_menu); + + context = this; + + //get preference menu info + if (KioskPreference.getInstance().getCartInfo() != null) { + getCartMenuList = new ArrayList<>(); + getCartMenuList = KioskPreference.getInstance().getCartInfo(); + } + + Gson gson = new Gson(); + LOGE(TAG, "getCartMenuList: " + gson.toJson(getCartMenuList)); + + cart_menu_rv_list = (RecyclerView) findViewById(R.id.cart_menu_rv_list); + cart_empty_layout = (View) findViewById(R.id.cart_empty_layout); + cart_menu_layout = (View) findViewById(R.id.cart_menu_layout); + cart_menu_ll_bottom = (LinearLayout) findViewById(R.id.cart_menu_ll_bottom); + cart_menu_tv_point = (TextView) findViewById(R.id.cart_menu_tv_point); + cart_menu_tv_payment_price = (TextView) findViewById(R.id.cart_menu_tv_payment_price); + cart_menu_tv_payment_count = (TextView) findViewById(R.id.cart_menu_tv_payment_count); + + cart_menu_btn_payment = (ImageView) findViewById(R.id.cart_menu_btn_payment); + + cart_menu_btn_payment.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.OrderBtnEvent(GaCategory.CART, getCartMenuList); + Intent intent = new Intent(context, PaymentActivity.class); + intent.putExtra("cartMenuList", getCartMenuList); + startActivity(intent); + } + }); + + if (getCartMenuList != null && getCartMenuList.size() != 0) { + //view content_cart_menu + cart_menu_layout.setVisibility(View.VISIBLE); + cart_menu_layout.setBackground(UiUtil.getDrawable(context, R.color.color_04)); + cart_menu_ll_bottom.setVisibility(View.VISIBLE); + cart_empty_layout.setVisibility(View.GONE); + + layoutManager = new LinearLayoutManager(this); + cartMenuAdapter = new CartMenuAdapter(context); + + cart_menu_rv_list.setHasFixedSize(true); + //cart_menu_rv_list.setNestedScrollingEnabled(false); + cart_menu_rv_list.setLayoutManager(layoutManager); + cart_menu_rv_list.setAdapter(cartMenuAdapter); + + cartMenuAdapter.clean(); + cartMenuAdapter.addItem(getCartMenuList); + cartMenuAdapter.notifyDataSetChanged(); + + int orderCountSum = 0; + int pointSum = 0; + double priceSum = 0.0; + double optionPriceSum = 0; + + for (int i = 0; i < getCartMenuList.size(); i++) { + + //TODO: fixme => order menu에서 cart를 누를경우 현재 포인트정보가 없음 test code + if (getCartMenuList.get(i).getMenu_point() == null || getCartMenuList.get(i).getMenu_point().equals("null")) { + pointSum = 0; + } else { + pointSum = pointSum + Integer.valueOf(getCartMenuList.get(i).getMenu_point()); + } + if (getCartMenuList.get(i).getMenu_price() == null || getCartMenuList.get(i).getMenu_price().equals("null")) { + priceSum = 0.0; + } else { + priceSum = priceSum + Double.valueOf(getCartMenuList.get(i).getMenu_price()); + } + orderCountSum = i; + + if (getCartMenuList.get(i).getCartMenuOptionItems() != null) { + for (int j = 0; j < getCartMenuList.get(i).getCartMenuOptionItems().size(); j ++) { + if (getCartMenuList.get(i).getCartMenuOptionItems().get(j).getMenu_option_price() == null) { + optionPriceSum = 0.0; + }else { + optionPriceSum = optionPriceSum + Double.valueOf(getCartMenuList.get(i).getCartMenuOptionItems().get(j).getMenu_option_price()); + } + } + } + + if (getCartMenuList.get(i).getCartMenuRequireOptionItems() != null) { + for (int j = 0; j < getCartMenuList.get(i).getCartMenuRequireOptionItems().size(); j ++) { + if (getCartMenuList.get(i).getCartMenuRequireOptionItems().get(j).getMenu_rq_option_price() == null) { + optionPriceSum = 0.0; + }else { + optionPriceSum = optionPriceSum + Double.valueOf(getCartMenuList.get(i).getCartMenuRequireOptionItems().get(j).getMenu_rq_option_price()); + } + } + } + + } + + orderCountSum = orderCountSum + 1; + LOGE(TAG, "pointSum :" + pointSum); + LOGE(TAG, "orderCountSum :" + orderCountSum); + LOGE(TAG, "priceSum :" + priceSum + optionPriceSum); + + //total + total = priceSum + optionPriceSum; + total = (int) (total * 100) / 100.0; + + //TODO: pointSum이 "null"로 오는거에 대한 처리 + + cart_menu_tv_point.setText(String.valueOf(pointSum) + "P"); + cart_menu_tv_payment_price.setText("$ "+ String.valueOf(total)); + //cart_menu_tv_payment_count.setText("Count :" + String.valueOf(orderCountSum)); + cart_menu_tv_payment_count.setText("Total"); + + } else { + //view content_cart_empty + cart_empty_layout.setVisibility(View.VISIBLE); + cart_menu_layout.setVisibility(View.GONE); + cart_menu_ll_bottom.setVisibility(View.GONE); + } + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + } + + public void clearCartList() { + if (getCartMenuList != null) { + getCartMenuList.clear(); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/cart/CartMenuAdapter.java b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuAdapter.java new file mode 100644 index 0000000..fcf54e1 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuAdapter.java @@ -0,0 +1,136 @@ +package net.bluehack.kiosk.cart; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.option.CartMenuOptionAdapter; +import net.bluehack.kiosk.cart.option.CartMenuRequiredOptionAdapter; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +public class CartMenuAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(CartMenuAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public CartMenuAdapter(Context context) { + this.context = context; + } + + @Override + public CartMenuViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.cart_menu_item, parent, false); + return new CartMenuViewHolder(v); + } + + @Override + public void onBindViewHolder(CartMenuViewHolder holder, final int position) { + + final CartMenuItem cartMenuItem = list.get(position); + final List cartMenuOptionItem = cartMenuItem.getCartMenuOptionItems(); + final List cartMenuRequireOptionItems = cartMenuItem.getCartMenuRequireOptionItems(); + + //cart menu option view + RecyclerView.LayoutManager optionLayoutManager = new LinearLayoutManager(context); + RecyclerView.LayoutManager requiredOptionLayoutManager = new LinearLayoutManager(context); + CartMenuOptionAdapter cartMenuOptionAdapter = new CartMenuOptionAdapter(context); + CartMenuRequiredOptionAdapter cartMenuRequiredOptionAdapter = new CartMenuRequiredOptionAdapter(context); + + //cart choice option + holder.cart_option_rv_list.setHasFixedSize(true); + holder.cart_option_rv_list.setLayoutManager(optionLayoutManager); + holder.cart_option_rv_list.setAdapter(cartMenuOptionAdapter); + + cartMenuOptionAdapter.clean(); + cartMenuOptionAdapter.addItem(cartMenuOptionItem); + cartMenuOptionAdapter.notifyDataSetChanged(); + + //cart required option + holder.cart_required_option_rv_list.setHasFixedSize(true); + holder.cart_required_option_rv_list.setLayoutManager(requiredOptionLayoutManager); + holder.cart_required_option_rv_list.setAdapter(cartMenuRequiredOptionAdapter); + + cartMenuRequiredOptionAdapter.clean(); + cartMenuRequiredOptionAdapter.addItem(cartMenuRequireOptionItems); + cartMenuRequiredOptionAdapter.notifyDataSetChanged(); + + final String url = UiUtil.getFileImgUrl(); + Glide.with(context) + .load(url + cartMenuItem.getMenu_image()) + .override(64, 64) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_a_default) + .into(holder.cart_menu_card_iv_img); + + String point = "0"; + if (cartMenuItem.getMenu_point() != null) { + point = cartMenuItem.getMenu_point(); + } + holder.cart_menu_card_tv_title.setText(cartMenuItem.getMenu_name()); + holder.cart_menu_card_tv_price.setText("$ " + cartMenuItem.getMenu_price()); + holder.cart_menu_card_iv_delete.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + KioskPreference.getInstance().deleteCartInfo(position); + Toast.makeText(context, context.getResources().getString(R.string.cart_delete), Toast.LENGTH_SHORT).show(); + notifyDataSetChanged(); + + LogEventTracker.RemoveBtnEvent(GaCategory.CART, cartMenuItem.getMenu_name()); + ((Activity) context).finish(); + Intent intent = new Intent(context, CartMenuActivity.class); + context.startActivity(intent); + + } + }); + + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/cart/CartMenuViewHolder.java b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuViewHolder.java new file mode 100644 index 0000000..f99168d --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/CartMenuViewHolder.java @@ -0,0 +1,35 @@ +package net.bluehack.kiosk.cart; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +import de.hdodenhof.circleimageview.CircleImageView; + +public class CartMenuViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + //ImageView cart_menu_card_iv_img; + CircleImageView cart_menu_card_iv_img; + ImageView cart_menu_card_iv_delete; + TextView cart_menu_card_tv_title; + TextView cart_menu_card_tv_price; + RecyclerView cart_option_rv_list; + RecyclerView cart_required_option_rv_list; + + public CartMenuViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.cart_menu_card_view); + this.cart_menu_card_iv_img = (CircleImageView) itemView.findViewById(R.id.cart_menu_card_iv_img); + this.cart_menu_card_iv_delete = (ImageView) itemView.findViewById(R.id.cart_menu_card_iv_delete); + this.cart_menu_card_tv_title = (TextView) itemView.findViewById(R.id.cart_menu_card_tv_title); + this.cart_menu_card_tv_price = (TextView) itemView.findViewById(R.id.cart_menu_card_tv_price); + this.cart_option_rv_list = (RecyclerView) itemView.findViewById(R.id.cart_option_rv_list); + this.cart_required_option_rv_list = (RecyclerView) itemView.findViewById(R.id.cart_required_option_rv_list); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionAdapter.java new file mode 100644 index 0000000..74f31b4 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionAdapter.java @@ -0,0 +1,67 @@ +package net.bluehack.kiosk.cart.option; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; + +import java.util.ArrayList; +import java.util.List; + +public class CartMenuOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(CartMenuOptionAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public CartMenuOptionAdapter(Context context) { + this.context = context; + } + + @Override + public CartMenuOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.cart_option_item, parent, false); + return new CartMenuOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(CartMenuOptionViewHolder holder, final int position) { + + final CartMenuOptionItem cartMenuOptionItem = list.get(position); + + holder.cart_menu_option_tv_title.setText(cartMenuOptionItem.getMenu_option_name()); + holder.cart_menu_option_price.setText("+ $" + cartMenuOptionItem.getMenu_option_price()); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionViewHolder.java new file mode 100644 index 0000000..d3eb4d4 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuOptionViewHolder.java @@ -0,0 +1,23 @@ +package net.bluehack.kiosk.cart.option; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class CartMenuOptionViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + TextView cart_menu_option_tv_title; + TextView cart_menu_option_price; + + public CartMenuOptionViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.cart_menu_option_card_view); + this.cart_menu_option_tv_title = (TextView) itemView.findViewById(R.id.cart_menu_option_tv_title); + this.cart_menu_option_price = (TextView) itemView.findViewById(R.id.cart_menu_option_price); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionAdapter.java new file mode 100644 index 0000000..aa139eb --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionAdapter.java @@ -0,0 +1,67 @@ +package net.bluehack.kiosk.cart.option; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; + +import java.util.ArrayList; +import java.util.List; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class CartMenuRequiredOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(CartMenuRequiredOptionAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public CartMenuRequiredOptionAdapter(Context context) { + this.context = context; + } + + @Override + public CartMenuRequiredOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.cart_required_option_item, parent, false); + return new CartMenuRequiredOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(CartMenuRequiredOptionViewHolder holder, final int position) { + + final CartMenuRequireOptionItem cartMenuRequireOptionItem = list.get(position); + + holder.cart_menu_required_option_tv_title.setText(cartMenuRequireOptionItem.getMenu_rq_option_name()); + holder.cart_menu_required_option_price.setText("+ $" + cartMenuRequireOptionItem.getMenu_rq_option_price()); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionViewHolder.java new file mode 100644 index 0000000..4445460 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/option/CartMenuRequiredOptionViewHolder.java @@ -0,0 +1,23 @@ +package net.bluehack.kiosk.cart.option; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class CartMenuRequiredOptionViewHolder extends RecyclerView.ViewHolder { + + CardView cart_menu_required_option_card_view; + TextView cart_menu_required_option_tv_title; + TextView cart_menu_required_option_price; + + public CartMenuRequiredOptionViewHolder(View itemView) { + super(itemView); + + this.cart_menu_required_option_card_view = (CardView) itemView.findViewById(R.id.cart_menu_required_option_card_view); + this.cart_menu_required_option_tv_title = (TextView) itemView.findViewById(R.id.cart_menu_required_option_tv_title); + this.cart_menu_required_option_price = (TextView) itemView.findViewById(R.id.cart_menu_required_option_price); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuItem.java b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuItem.java new file mode 100644 index 0000000..9d53caf --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuItem.java @@ -0,0 +1,92 @@ +package net.bluehack.kiosk.cart.vo; + +import java.io.Serializable; +import java.util.List; + +public class CartMenuItem implements Serializable { + + private String menu_id; + private String menu_name; + private String menu_price; + private String menu_point; + private String menu_image; + private String menu_description; + private String menu_calory; + private List cartMenuRequireOptionItems; + private List cartMenuOptionItems; + + public CartMenuItem() { + } + + public String getMenu_id() { + return menu_id; + } + + public void setMenu_id(String menu_id) { + this.menu_id = menu_id; + } + + public String getMenu_name() { + return menu_name; + } + + public void setMenu_name(String menu_name) { + this.menu_name = menu_name; + } + + public String getMenu_price() { + return menu_price; + } + + public void setMenu_price(String menu_price) { + this.menu_price = menu_price; + } + + public String getMenu_point() { + return menu_point; + } + + public void setMenu_point(String menu_point) { + this.menu_point = menu_point; + } + + public String getMenu_image() { + return menu_image; + } + + public void setMenu_image(String menu_image) { + this.menu_image = menu_image; + } + + public String getMenu_description() { + return menu_description; + } + + public void setMenu_description(String menu_description) { + this.menu_description = menu_description; + } + + public String getMenu_calory() { + return menu_calory; + } + + public void setMenu_calory(String menu_calory) { + this.menu_calory = menu_calory; + } + + public List getCartMenuRequireOptionItems() { + return cartMenuRequireOptionItems; + } + + public void setCartMenuRequireOptionItems(List cartMenuRequireOptionItems) { + this.cartMenuRequireOptionItems = cartMenuRequireOptionItems; + } + + public List getCartMenuOptionItems() { + return cartMenuOptionItems; + } + + public void setCartMenuOptionItems(List cartMenuOptionItems) { + this.cartMenuOptionItems = cartMenuOptionItems; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuOptionItem.java b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuOptionItem.java new file mode 100644 index 0000000..8012f10 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuOptionItem.java @@ -0,0 +1,52 @@ +package net.bluehack.kiosk.cart.vo; + +import java.io.Serializable; + +public class CartMenuOptionItem implements Serializable { + + private String menu_option_id; + private String menu_option_name; + private String menu_option_price; + private String menu_option_calory; + private boolean isChecked; + + public String getMenu_option_id() { + return menu_option_id; + } + + public void setMenu_option_id(String menu_option_id) { + this.menu_option_id = menu_option_id; + } + + public String getMenu_option_name() { + return menu_option_name; + } + + public void setMenu_option_name(String menu_option_name) { + this.menu_option_name = menu_option_name; + } + + public String getMenu_option_price() { + return menu_option_price; + } + + public void setMenu_option_price(String menu_option_price) { + this.menu_option_price = menu_option_price; + } + + public String getMenu_option_calory() { + return menu_option_calory; + } + + public void setMenu_option_calory(String menu_option_calory) { + this.menu_option_calory = menu_option_calory; + } + + public boolean isChecked() { + return isChecked; + } + + public void setChecked(boolean checked) { + isChecked = checked; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuRequireOptionItem.java b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuRequireOptionItem.java new file mode 100644 index 0000000..8ae47f0 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/cart/vo/CartMenuRequireOptionItem.java @@ -0,0 +1,61 @@ +package net.bluehack.kiosk.cart.vo; + +import java.io.Serializable; + +public class CartMenuRequireOptionItem implements Serializable { + + private String menu_rq_option_id; + private String menu_rq_option_name; + private String menu_rq_option_price; + private String menu_rq_option_calory; + private boolean isChecked; + private boolean requiredChecked; + + public String getMenu_rq_option_id() { + return menu_rq_option_id; + } + + public void setMenu_rq_option_id(String menu_rq_option_id) { + this.menu_rq_option_id = menu_rq_option_id; + } + + public String getMenu_rq_option_name() { + return menu_rq_option_name; + } + + public void setMenu_rq_option_name(String menu_rq_option_name) { + this.menu_rq_option_name = menu_rq_option_name; + } + + public String getMenu_rq_option_price() { + return menu_rq_option_price; + } + + public void setMenu_rq_option_price(String menu_rq_option_price) { + this.menu_rq_option_price = menu_rq_option_price; + } + + public String getMenu_rq_option_calory() { + return menu_rq_option_calory; + } + + public void setMenu_rq_option_calory(String menu_rq_option_calory) { + this.menu_rq_option_calory = menu_rq_option_calory; + } + + public boolean isChecked() { + return isChecked; + } + + public void setChecked(boolean checked) { + isChecked = checked; + } + + public boolean isRequiredChecked() { + return requiredChecked; + } + + public void setRequiredChecked(boolean requiredChecked) { + this.requiredChecked = requiredChecked; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/contact/ContactActivity.java b/app/src/main/java/net/bluehack/kiosk/contact/ContactActivity.java new file mode 100644 index 0000000..8dd5c34 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/contact/ContactActivity.java @@ -0,0 +1,63 @@ +package net.bluehack.kiosk.contact; + +import android.content.Context; +import android.net.Uri; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.text.SpannableString; +import android.text.method.LinkMovementMethod; +import android.text.style.UnderlineSpan; +import android.text.util.Linkify; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +public class ContactActivity extends BaseActivity { + + private Context context; + private TextView tvPhone; + private LinearLayout llContact; + private String store_phone; + private boolean ischeckedLink = false; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_contact); + + context = this; + tvPhone = (TextView) findViewById(R.id.tvPhone); + + store_phone = "000-0000-0000"; + if (KioskPreference.getInstance().getStoreInfo() != null) { + store_phone = KioskPreference.getInstance().getStoreInfo().getSPhone(); + } + + if (!store_phone.contains("-")) { + String sign = "-"; + StringBuffer sb = new StringBuffer(); + sb.append(store_phone.substring(0,3)); + sb.append(sign); + sb.append(store_phone.substring(3,store_phone.length()-1)); + store_phone = sb.toString(); + } + + tvPhone.setText(store_phone); + tvPhone.setLinkTextColor(UiUtil.getColor(context, R.color.color_09)); + tvPhone.setLinksClickable(true); + tvPhone.setAutoLinkMask(Linkify.PHONE_NUMBERS); + //tvPhone.setMovementMethod(LinkMovementMethod.getInstance()); + Linkify.addLinks(tvPhone, Linkify.PHONE_NUMBERS); + + if (tvPhone.isFocused()) { + LogEventTracker.ContactUsEvent(GaCategory.CONTACT_US, store_phone); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/history/HistoryActivity.java b/app/src/main/java/net/bluehack/kiosk/history/HistoryActivity.java new file mode 100644 index 0000000..2ca81ec --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/history/HistoryActivity.java @@ -0,0 +1,130 @@ +package net.bluehack.kiosk.history; + +import android.content.Context; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import com.google.gson.Gson; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.home.model.Menu; +import net.bluehack.kiosk.home.model.Store; +import net.bluehack.kiosk.home.model.Ticket; +import net.bluehack.kiosk.util.KioskPreference; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class HistoryActivity extends BaseActivity { + + private static final String TAG = makeLogTag(HistoryActivity.class); + Context context; + TextView tvTitle; + ListView lvHistory; + LinearLayout llNoneHistory; + HistoryTicketAdapter adapter; + View history_exist; + View history_empty; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_history); + + context = this; + + lvHistory = (ListView) findViewById(R.id.lvHistory); + llNoneHistory = (LinearLayout) findViewById(R.id.llNoneHistory); + tvTitle = (TextView) findViewById(R.id.tvTitle); + history_exist = (View) findViewById(R.id.history_exist); + history_empty = (View) findViewById(R.id.history_empty); + + adapter = new HistoryTicketAdapter(); + lvHistory.setAdapter(adapter); + + //TODO: fixme => test user_id 사용 및 정렬 옵션 api 처리 x + String storeId = ""; + String userId = ""; + if (KioskPreference.getInstance().getStoreInfo() != null) { + storeId = KioskPreference.getInstance().getStoreInfo().getStoreId(); + userId = KioskPreference.getInstance().getStoreInfo().getUserId(); + } + OrderReq orderReq = new OrderReq(); + orderReq.setStoreId(storeId); + orderReq.setUserId(userId); + orderReq.setOrderBy("createDate"); + orderReq.setOrderByWith("desc"); + getRecentOrderlist(context, orderReq); + } + + private void getRecentOrderlist(final Context context, final OrderReq orderReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().orderPaymentListPost(context, orderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + OrderRes orderRes = (OrderRes) result; + + Gson gson = new Gson(); + LOGE(TAG, "orderPaymentListPost result : " + gson.toJson(result)); + + if (orderRes.getResponseStatus() != null && orderRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + history_exist.setVisibility(View.VISIBLE); + history_empty.setVisibility(View.GONE); + + adapter.clean(); + + for (int i = 0; i < orderRes.getData().size(); i++) { + adapter.addItem(orderRes.getData().get(i)); + } + + if (adapter.getCount() == 0) { + lvHistory.setVisibility(View.GONE); + llNoneHistory.setVisibility(View.VISIBLE); + } else { + lvHistory.setVisibility(View.VISIBLE); + llNoneHistory.setVisibility(View.GONE); + } + adapter.notifyDataSetChanged(); + + } else { + //Toast.makeText(ApplicationLoader.getContext(), "can't get menu option list.", Toast.LENGTH_SHORT).show(); + history_exist.setVisibility(View.GONE); + history_empty.setVisibility(View.VISIBLE); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status) , Toast.LENGTH_SHORT).show(); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketAdapter.java b/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketAdapter.java new file mode 100644 index 0000000..00e9e19 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketAdapter.java @@ -0,0 +1,150 @@ +package net.bluehack.kiosk.history; + +import android.content.Context; +import android.content.Intent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.home.model.Ticket; +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.model.OrderResData; + +public class HistoryTicketAdapter extends BaseAdapter { + + Context context; + List tickets = new ArrayList<>(); + + @Override + public int getCount() { + return tickets.size(); + } + + @Override + public Object getItem(int position) { + return tickets.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(final int position, View convertView, final ViewGroup parent) { + + context = parent.getContext(); + final OrderResData ticket = tickets.get(position); + + ViewHolder viewHolder; + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.history_item, parent, false); + + viewHolder = new ViewHolder(); + viewHolder.llTicketMenu = (LinearLayout) convertView.findViewById(R.id.llTicketMenu); + viewHolder.tvDish = (TextView) convertView.findViewById(R.id.tvDish); + viewHolder.lvDishes = (ListView) convertView.findViewById(R.id.lvDishes); + viewHolder.tvDate = (TextView) convertView.findViewById(R.id.tvDate); + viewHolder.tvDish_img = (CircleImageView) convertView.findViewById(R.id.tvDish_img); + viewHolder.tvDish_color = (CircleImageView) convertView.findViewById(R.id.tvDish_color); + + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + + viewHolder.llTicketMenu.setBackgroundColor(UiUtil.getColor(context, R.color.color_03)); + + Glide.with(context) + .load(ticket.getDetail().get(0).getDetailFileId()) + .override(80, 80) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_b_default) + .into(viewHolder.tvDish_img); + + int cookStatus = 0; + String cookStatusStr = "ing..."; + String date; + + if (ticket.getCookStatus() != null) { + cookStatus = ticket.getCookStatus(); + + if (cookStatus == Ticket.COMPLETE) { + cookStatusStr = "Completed"; + viewHolder.tvDish.setTextSize(11); + viewHolder.tvDish_color.setImageResource(R.color.color_48); + } else { + viewHolder.tvDish.setTextSize(13); + viewHolder.tvDish_color.setImageResource(R.color.color_47); + } + } + + if (ticket.getRegidate() != null) { + date = ticket.getRegidate(); + } else { + date = ""; + } + + viewHolder.tvDish.setText(cookStatusStr); + viewHolder.tvDate.setText(date); + HistoryTicketDishAdapter adapter = new HistoryTicketDishAdapter(); + adapter.setItem(ticket.getDetail()); + viewHolder.lvDishes.setAdapter(adapter); + UiUtil.drawListViewFitHeight(viewHolder.lvDishes, adapter); + + viewHolder.llTicketMenu.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + ((ListView) parent).performItemClick(v, position, 0); + + LogEventTracker.OrderHistoryEvent(GaCategory.ORDERHISTORY, ticket.getOrderId()); + Intent intent = new Intent(context, TicketActivity.class); + String orderInfo = UiUtil.toStringGson(tickets.get(position)); + intent.putExtra("clicked_order", orderInfo); + + context.startActivity(intent); + } + }); + + return convertView; + } + + public void addItem(OrderResData ticket) { + tickets.add(ticket); + } + + public void clean() { + if (tickets != null) { + tickets.clear(); + } + } + + public class ViewHolder { + + LinearLayout llTicketMenu; + TextView tvDish; + ListView lvDishes; + TextView tvDate; + CircleImageView tvDish_img; + CircleImageView tvDish_color; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketDishAdapter.java b/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketDishAdapter.java new file mode 100644 index 0000000..6d4494a --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/history/HistoryTicketDishAdapter.java @@ -0,0 +1,80 @@ +package net.bluehack.kiosk.history; + +import android.content.Context; +import android.content.Intent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.R; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.OrderResDetail; + +public class HistoryTicketDishAdapter extends BaseAdapter { + + Context context; + List menus = new ArrayList<>(); + + @Override + public int getCount() { + return menus.size(); + } + + @Override + public Object getItem(int position) { + return menus.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + + context = parent.getContext(); + OrderResDetail menu = menus.get(position); + + ViewHolder viewHolder; + + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.history_dishes_name_item, parent, false); + + viewHolder = new ViewHolder(); + + viewHolder.tvDishName = (TextView) convertView.findViewById(R.id.tvDishName); + + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + + viewHolder.tvDishName.setText(menu.getDetailMenuName()); + + return convertView; + } + + public void setItem(List menus) { + + if (menus != null) { + this.menus.clear(); + this.menus = menus; + } + } + + public class ViewHolder { + + public TextView tvDishName; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/DishAdapter.java b/app/src/main/java/net/bluehack/kiosk/home/DishAdapter.java new file mode 100644 index 0000000..5be20b2 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/DishAdapter.java @@ -0,0 +1,117 @@ +package net.bluehack.kiosk.home; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.model.OrderResDetail; + +import static net.bluehack.kiosk.util.Logger.LOGE; + +public class DishAdapter extends BaseAdapter { + + /** + * home의 recent order에서 보이는 이미지와 이미지 갯수 페이지 */ + Context context; + //List

menus = new ArrayList<>(); + List menus = new ArrayList<>(); + + @Override + public int getCount() { + return menus.size(); + } + + @Override + public Object getItem(int position) { + return menus.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + + MenuViewHolder viewHolder; + context = parent.getContext(); + + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.dish_item, parent, false); + + viewHolder = new MenuViewHolder(); + viewHolder.ivMenu = (CircleImageView) convertView.findViewById(R.id.ivMenu); + viewHolder.tvMenuName = (TextView) convertView.findViewById(R.id.tvMenuName); + + convertView.setTag(viewHolder); + } else { + viewHolder = (MenuViewHolder) convertView.getTag(); + } + + OrderResDetail menu = menus.get(position); + + final String url = UiUtil.getFileImgUrl(); + int menuCount = 0; + Glide.with(context) + .load(url + menu.getDetailFileId()) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .centerCrop() + .error(R.drawable.img_menu_sample_a_default) + .into(viewHolder.ivMenu); + + if (menu.getDetailQuantity() != null) { + menuCount = menu.getDetailQuantity(); + } + viewHolder.tvMenuName.setText(String.valueOf(menuCount)); + + return convertView; + } + + public void clean() { + if (menus != null) { + menus.clear(); + } + } + + public void addTicket(OrderResDetail menu) { + this.menus.add(menu); + } + public void add(List menus) { + this.menus = menus; + } + + public void addList(List menus) { + this.menus.clear(); + if (menus == null) { + return; + } + this.menus = menus; + } + + public class MenuViewHolder { + public CircleImageView ivMenu; + public TextView tvMenuName; + } + + @Override + public boolean isEnabled(int position) { + return false; + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/home/DishDetailAdapter.java b/app/src/main/java/net/bluehack/kiosk/home/DishDetailAdapter.java new file mode 100644 index 0000000..273829e --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/DishDetailAdapter.java @@ -0,0 +1,169 @@ +package net.bluehack.kiosk.home; + +import android.app.Activity; +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderReqDetail; +import io.swagger.client.model.AddOrderReqOption; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.OrderResDetail; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class DishDetailAdapter extends BaseAdapter { + + Context context; + List menus = new ArrayList<>(); + + private static final String TAG = makeLogTag(DishDetailAdapter.class); + private List orderList = null; + + @Override + public int getCount() { + return menus.size(); + } + + @Override + public Object getItem(int position) { + return menus.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + + ViewHolder viewHolder; + final OrderResDetail menu = menus.get(position); + + context = parent.getContext(); + + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.dish_detail_item, parent, false); + + viewHolder = new ViewHolder(); + + viewHolder.ivDish = (CircleImageView) convertView.findViewById(R.id.tvDish); + viewHolder.tvDishName = (TextView) convertView.findViewById(R.id.tvDishName); + viewHolder.tvPrice = (TextView) convertView.findViewById(R.id.tvPrice); + viewHolder.lvOptions = (ListView) convertView.findViewById(R.id.lvOptions); + viewHolder.ivAddCart = (ImageView) convertView.findViewById(R.id.ivAddCart); + + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + + // Fixme : order에서 menu option type 꼭 필요함. + /*viewHolder.ivDish.setBackground( + UiUtil.getDrawable(context, R.drawable.img_menu_sample_a_05));*/ + final String url = UiUtil.getFileImgUrl(); + Glide.with(context) + .load(url + menu.getDetailFileId()) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_a_default) + .into(viewHolder.ivDish); + + viewHolder.tvDishName.setText(menu.getDetailMenuName()); + viewHolder.tvPrice.setText(String.valueOf("$ " + String.valueOf(menu.getDetailPrice()))); + viewHolder.ivAddCart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CartMenuItem cartMenuItem = new CartMenuItem(); + List cartMenuOptionList = new ArrayList(); + cartMenuItem.setMenu_id(menu.getDetailMenuId()); + cartMenuItem.setMenu_image(menu.getDetailFileId()); + cartMenuItem.setMenu_name(menu.getDetailMenuName()); + cartMenuItem.setMenu_price(String.valueOf(menu.getDetailPrice())); + //cartMenuItem.setCartMenuOptionItems(menu.getOption()); + //TODO: fixme => 차후 /order/detail api에서 calory정보까지 받아오기 + //cartMenuItem.setMenu_calory(); + //cartMenuItem.setMenu_point(); + //cartMenuItem.setMenu_description(); + //menu.getOption().get(0).option_type + //order num 받아오기 + + //TODO: fixme => api가 현재 menu option type을 주지않아 테스트 코드 + for (int i = 0; i < menu.getOption().size(); i ++) { + CartMenuOptionItem cartMenuOptionItem = new CartMenuOptionItem(); + cartMenuOptionItem.setMenu_option_id(menu.getOption().get(i).getOptionMenuId()); + cartMenuOptionItem.setMenu_option_name(menu.getOption().get(i).getOptionMenuName()); + cartMenuOptionItem.setMenu_option_price(String.valueOf(menu.getOption().get(i).getOptionPrice())); + cartMenuOptionList.add(cartMenuOptionItem); + } + cartMenuItem.setCartMenuOptionItems(cartMenuOptionList); + + KioskPreference.getInstance().setCartInfo(cartMenuItem); + Toast.makeText(context, context.getResources().getString(R.string.add_cart) , Toast.LENGTH_SHORT).show(); + View menu_cart_tv = ((Activity)context).getWindow().findViewById(R.id.menu_cart_tv); + menu_cart_tv.setVisibility(View.VISIBLE); + + LogEventTracker.TapAddCartEvent(GaCategory.ORDERHISTORYDETAIL, cartMenuItem); + } + }); + + DishDetailOptionAdapter adapter = new DishDetailOptionAdapter(); + adapter.setList(menu.getOption()); + + UiUtil.drawListViewFitHeight(viewHolder.lvOptions, adapter); + viewHolder.lvOptions.setSelector(R.drawable.listview_non_selector); + + viewHolder.lvOptions.setAdapter(adapter); + + return convertView; + } + + public void addList(List menus) { + this.menus.clear(); + if (menus == null) { + return; + } + this.menus = menus; + } + + public class ViewHolder { + + public ImageView ivDish; + public ImageView ivAddCart; + public TextView tvDishName; + public TextView tvPrice; + + ListView lvOptions; + + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/DishDetailOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/home/DishDetailOptionAdapter.java new file mode 100644 index 0000000..a5cb129 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/DishDetailOptionAdapter.java @@ -0,0 +1,83 @@ +package net.bluehack.kiosk.home; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.OrderResOption; + +public class DishDetailOptionAdapter extends BaseAdapter { + + Context context; + private List list = new ArrayList<>(); + + @Override + public int getCount() { + return list.size(); + } + + @Override + public Object getItem(int position) { + return list.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + + context = parent.getContext(); + OrderResOption option = list.get(position); + + ViewHolder viewHolder; + + String optionPrice = "0"; + + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + + convertView = inflater.inflate(R.layout.dish_detail_option_item, parent, false); + + viewHolder = new ViewHolder(); + viewHolder.tvOption = (TextView) convertView.findViewById(R.id.tvOption); + viewHolder.tvOption_price = (TextView) convertView.findViewById(R.id.tvOption_price); + + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + + if (option.getOptionPrice() != null) { + optionPrice = String.valueOf(option.getOptionPrice()); + } + viewHolder.tvOption.setText(option.getOptionMenuName()); + viewHolder.tvOption_price.setText("+ $" + optionPrice); + + return convertView; + } + + public void setList(List list) { + this.list.clear(); + if (list == null) { + return; + } + this.list = list; + } + + public class ViewHolder { + TextView tvOption; + TextView tvOption_price; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/HomeActivity.java b/app/src/main/java/net/bluehack/kiosk/home/HomeActivity.java new file mode 100644 index 0000000..1798819 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/HomeActivity.java @@ -0,0 +1,426 @@ +package net.bluehack.kiosk.home; + + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.content.Context; +import android.content.Intent; +import android.graphics.Color; +import android.graphics.Typeface; +import android.os.Build; +import android.os.Bundle; +import android.support.design.widget.NavigationView; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.style.ForegroundColorSpan; +import android.view.KeyEvent; +import android.view.MenuItem; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.google.gson.Gson; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.contact.ContactActivity; +import net.bluehack.kiosk.history.HistoryActivity; +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.myinfo.MyInfoActivity; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.store.StoreActivity; +import net.bluehack.kiosk.subcategory.SubCategoryActivity; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.ApiClient; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; +import io.swagger.client.model.OrderResData; +import io.swagger.client.model.StoresResData; + +public class HomeActivity extends BaseActivity { + + private static final String TAG = makeLogTag(HomeActivity.class); + private Context context; + private DrawerLayout drawerLayout; + private NavigationView navigationView; + private FrameLayout drawer_header_iv_close; + private CircleImageView ivStoreLogo; + private TextView tvStoreName; + private TextView tvStoreAddress; + private TextView tvGiftPoint; + private ListView lvRecentlyOrder; + private LinearLayout llHomeRecentlyOrder; + private LinearLayout llHomeMobilePayment; + private TicketAdapter ticketAdapter; + private TextView menu_cart_tv; + private LinearLayout nav_item_01; + private LinearLayout nav_item_02; + private LinearLayout nav_item_03; + private LinearLayout nav_item_04; + private LinearLayout nav_item_05; + private TextView tvOtherView; + private String storeName; + + public HomeActivity(){} + + @Override + protected void onStart() { + super.onStart(); + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + context = this; + + setContentView(R.layout.activity_home); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + ActionBar actionBar = getSupportActionBar(); + actionBar.setHomeAsUpIndicator(R.drawable.btn_main_menu); + actionBar.setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowTitleEnabled(false); + + drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); + navigationView = (NavigationView) findViewById(R.id.navigation_view); + drawer_header_iv_close = (FrameLayout) findViewById(R.id.drawer_header_iv_close); + menu_cart_tv = (TextView) findViewById(R.id.menu_cart_tv); + nav_item_01 = (LinearLayout) findViewById(R.id.nav_item_01); + nav_item_02 = (LinearLayout) findViewById(R.id.nav_item_02); + nav_item_03 = (LinearLayout) findViewById(R.id.nav_item_03); + nav_item_04 = (LinearLayout) findViewById(R.id.nav_item_04); + nav_item_05 = (LinearLayout) findViewById(R.id.nav_item_05); + + drawer_header_iv_close.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + drawerLayout.closeDrawers(); + } + }); + + nav_item_01.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.SlideMyInfoBtnEvent(GaCategory.SLIDEMENU); + Intent myinfoIntent = new Intent(context, MyInfoActivity.class); + myinfoIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(myinfoIntent); + } + }); + + nav_item_02.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.SlideStoreBtnEvent(GaCategory.SLIDEMENU); + Intent storeIntent = new Intent(context, StoreActivity.class); + storeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(storeIntent); + } + }); + + nav_item_03.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.SlideOrderHistoryBtnEvent(GaCategory.SLIDEMENU); + Intent historyIntent = new Intent(context, HistoryActivity.class); + historyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(historyIntent); + } + }); + + nav_item_04.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.CartBtnEvent(GaCategory.SLIDEMENU); + Intent cartIntent = new Intent(context, CartMenuActivity.class); + cartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(cartIntent); + } + }); + + nav_item_05.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.SlideContactusBtnEvent(GaCategory.SLIDEMENU); + Intent contactIntent = new Intent(context, ContactActivity.class); + contactIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(contactIntent); + } + }); + + tvOtherView = (TextView) findViewById(R.id.tvOtherView); + tvOtherView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ViewAllBtnEvent(GaCategory.HOME); + Intent i = new Intent(HomeActivity.this, HistoryActivity.class); + startActivity(i); + } + }); + + TextView tvMobileOther = (TextView) findViewById(R.id.tvMobileOrder); + tvMobileOther.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.MoblieOrderBtnEvent(GaCategory.HOME); + Intent i = new Intent(HomeActivity.this, SubCategoryActivity.class); + startActivity(i); + //startActivityForResult(i, 0); + } + }); + + // Store UI 연결 + ivStoreLogo = (CircleImageView) findViewById(R.id.ivStoreLogo); + tvStoreName = (TextView) findViewById(R.id.tvStoreName); + tvStoreAddress = (TextView) findViewById(R.id.tvStoreAddress); + tvGiftPoint = (TextView) findViewById(R.id.tvGiftPoint); + + llHomeRecentlyOrder = (LinearLayout) findViewById(R.id.llHomeRecentlyOrder); + llHomeMobilePayment = (LinearLayout) findViewById(R.id.llHomeMobilePayment); + + // Recently order + lvRecentlyOrder = (ListView) findViewById(R.id.lvRecentlyOrder); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + lvRecentlyOrder.setNestedScrollingEnabled(false); + } + + ticketAdapter = new TicketAdapter(); + lvRecentlyOrder.setAdapter(ticketAdapter); + + updateStoreUI(); + + ImageView ivChangeStore = (ImageView) findViewById(R.id.ivChangeStore); + ivChangeStore.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ChangeStoreEvent(GaCategory.HOME, storeName); + Intent intent = new Intent(context, StoreActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + } + }); + } + + private void getRecentOrderlist(final Context context, final OrderReq orderReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().orderPaymentListPost(context, orderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + OrderRes orderRes = (OrderRes) result; + + Gson gson = new Gson(); + LOGD(TAG, "orderPaymentListPost result : " + gson.toJson(result)); + + if (orderRes.getResponseStatus() != null && orderRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + ticketAdapter.clean(); + + List orderResDataList = new ArrayList(); + for (int i = 0; i < orderRes.getData().size(); i++) { + orderResDataList.add(orderRes.getData().get(i)); + } + //ticketAdapter.add(orderResDataList); + ticketAdapter.addItem(orderResDataList, tvOtherView); + ticketAdapter.notifyDataSetChanged(); + + } else { + //Toast.makeText(ApplicationLoader.getContext(), "can't get menu option list.", Toast.LENGTH_SHORT).show(); + } + + updateRecentlyOrder(); + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + + private void updateStoreUI() { + // store info + final StoresResData storeInfo = KioskPreference.getInstance().getStoreInfo(); + + String storeImg = storeInfo.getSLogo(); + storeName = storeInfo.getStore(); + String storeAddr = storeInfo.getSAddress(); + int storePoint = 0; + if (storeInfo.getUPoints() != null) { + storePoint = storeInfo.getUPoints(); + } + + // logo image, name, address + final String url = UiUtil.getFileImgUrl(); + + Glide.with(context) + .load(url + storeImg) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_storelogo_sample_03) + .into(ivStoreLogo); + + tvStoreName.setText(storeName); + tvStoreAddress.setText(storeAddr); + tvGiftPoint.setText(String.valueOf(storePoint)); + } + + private void updateRecentlyOrder() { + if (ticketAdapter == null || ticketAdapter.getCount() <= 0) { + // 빈화면 처리 + llHomeRecentlyOrder.setVisibility(View.INVISIBLE); + llHomeMobilePayment.setVisibility(View.VISIBLE); + tvOtherView.setVisibility(View.INVISIBLE); + } else { + // 최대 3개까지 표현 + llHomeRecentlyOrder.setVisibility(View.VISIBLE); + llHomeMobilePayment.setVisibility(View.INVISIBLE); + + ticketAdapter.notifyDataSetChanged(); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + switch (id) { + case android.R.id.home: + drawerLayout.openDrawer(GravityCompat.START); + LogEventTracker.NavMenuBtnEvent(GaCategory.HOME); + return true; + } + + return super.onOptionsItemSelected(item); + } + + @Override + protected void onResume() { + super.onResume(); + + String storeId = ""; + String userId = ""; + if (KioskPreference.getInstance().getStoreInfo() != null) { + storeId = KioskPreference.getInstance().getStoreInfo().getStoreId(); + userId = KioskPreference.getInstance().getStoreInfo().getUserId(); + } + + if (KioskPreference.getInstance().getCartInfo() != null) { + + if (KioskPreference.getInstance().getCartInfo().size() != 0) { + menu_cart_tv.setVisibility(View.VISIBLE); + } else { + menu_cart_tv.setVisibility(View.INVISIBLE); + } + } + + OrderReq orderReq = new OrderReq(); + orderReq.setStoreId(storeId); + orderReq.setUserId(userId); + orderReq.setStartNo(0); + orderReq.setCnt(3); + orderReq.setOrderBy("createDate"); + orderReq.setOrderByWith("desc"); + getRecentOrderlist(context, orderReq); + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) + { + if ((keyCode == KeyEvent.KEYCODE_BACK)) + { + if (drawerLayout.isDrawerOpen(GravityCompat.START)) { + drawerLayout.closeDrawers(); + return false; + } else { + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_exit)); + tvLeftButton.setText(context.getResources().getString(R.string.popup_quit_left_btn)); + tvRightButton.setText(context.getResources().getString(R.string.popup_quit_right_btn)); + tvTitle.setText(context.getResources().getString(R.string.popup_quit_title)); + tvMessage.setText(context.getResources().getString(R.string.popup_quit_message)); + + String appName = "Digital Checkouts"; + String sub = context.getResources().getString(R.string.popup_quit_sub); + String subMessage = appName + sub; + Spannable sp = new SpannableString(subMessage); + sp.setSpan(new ForegroundColorSpan(Color.RED), 0, appName.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + tvSubMessage.setText(sp); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_quit_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_quit_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_quit_title), + tvRightButton.getText().toString()); + popup.dismiss(); + finish(); + } + }); + } + } + return super.onKeyDown(keyCode, event); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/KioskConstant.java b/app/src/main/java/net/bluehack/kiosk/home/KioskConstant.java new file mode 100644 index 0000000..eef3fa9 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/KioskConstant.java @@ -0,0 +1,5 @@ +package net.bluehack.kiosk.home; + +public class KioskConstant { + public static final String TICKET = "TICKET"; +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/TicketAdapter.java b/app/src/main/java/net/bluehack/kiosk/home/TicketAdapter.java new file mode 100644 index 0000000..30936e4 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/TicketAdapter.java @@ -0,0 +1,291 @@ +package net.bluehack.kiosk.home; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.support.v4.content.ContextCompat; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.FrameLayout; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.home.model.Ticket; +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.OrderResData; + +public class TicketAdapter extends BaseAdapter { + + Context context; + //List tickets = new ArrayList<>(); + List tickets = new ArrayList<>(); + + @Override + public int getCount() { + return tickets.size(); + } + + @Override + public Object getItem(int position) { + if (position >= tickets.size()) { + return null; + } + return tickets.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(final int position, View convertView, final ViewGroup parent) { + + final TicketViewHolder viewHolder; + final OrderResData ticket = tickets.get(position); + + context = parent.getContext(); + + if (!(convertView instanceof View)) { + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.ticket_item, parent, false); + + viewHolder = new TicketViewHolder(); + + // mapping viewHolder + viewHolder.flTicket = (FrameLayout) convertView.findViewById(R.id.flTicket); + viewHolder.tvOrderDate = (TextView) convertView.findViewById(R.id.tvOrderDate); + viewHolder.tvTicketPrice = (TextView) convertView.findViewById(R.id.tvTicketPrice); + viewHolder.gvMenu = (GridView) convertView.findViewById(R.id.gvMenu); + + viewHolder.llProcessState = (LinearLayout) convertView.findViewById(R.id.llProcessState); + + viewHolder.tvOrderNo = (TextView) convertView.findViewById(R.id.tvOrderNo); + + viewHolder.ivPayment = (ImageView) convertView.findViewById(R.id.ivPayment); + viewHolder.tvPayment = (TextView) convertView.findViewById(R.id.tvPayment); + + viewHolder.ivReceive = (ImageView) convertView.findViewById(R.id.ivReceive); + viewHolder.tvReceive = (TextView) convertView.findViewById(R.id.tvReceive); + + viewHolder.ivMaking = (ImageView) convertView.findViewById(R.id.ivMaking); + viewHolder.tvMaking = (TextView) convertView.findViewById(R.id.tvMaking); + + viewHolder.ivComplete = (ImageView) convertView.findViewById(R.id.ivComplete); + viewHolder.tvComplete = (TextView) convertView.findViewById(R.id.tvComplete); + + viewHolder.viewStateLineToInCook = (View) convertView.findViewById(R.id.viewStateLineToInCook); + viewHolder.viewStateLineToReady = (View) convertView.findViewById(R.id.viewStateLineToReady); + + convertView.setTag(viewHolder); + } else { + + viewHolder = (TicketViewHolder) convertView.getTag(); + } + + viewHolder.tvOrderDate.setText(ticket.getRegidate()); + viewHolder.tvTicketPrice.setText("$ " + String.valueOf(ticket.getPrice())); + + //TODO: fixme => 현재 test api에서 cookstatus가 null로 들어옴 (홈화면에서 보이는 곳) + // gridview 처리하기 + //if (ticket.getCookStatus() < Ticket.EXPIRE) { + if (ticket.getCookStatus() == null) { + ticket.setCookStatus(1); + } + + viewHolder.tvPayment.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + viewHolder.tvReceive.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + viewHolder.tvMaking.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + viewHolder.tvComplete.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + viewHolder.viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + viewHolder.viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + + if (ticket.getCookStatus() != null) { + // showing process + viewHolder.llProcessState.setVisibility(View.VISIBLE); + switch (ticket.getCookStatus()) { + case Ticket.PAYMENT: + viewHolder.ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + viewHolder.ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + viewHolder.ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + viewHolder.ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + viewHolder.tvPayment.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + break; + case Ticket.RECEIVE: + viewHolder.ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + viewHolder.ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + viewHolder.ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + viewHolder.tvReceive.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + viewHolder.viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + viewHolder.viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + break; + case Ticket.MAKING: + viewHolder.ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + viewHolder.ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + viewHolder.tvMaking.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + viewHolder.viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + viewHolder.viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + break; + case Ticket.COMPLETE: + viewHolder.ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + viewHolder.ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + + viewHolder.tvComplete.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + break; + + default: + viewHolder.ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + viewHolder.ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + viewHolder.ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + viewHolder.ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + break; + } + } else { + viewHolder.llProcessState.setVisibility(View.INVISIBLE); + } + + int ticketOrderNum = 0; + if (ticket.getOrderNum() != null) { + ticketOrderNum = ticket.getOrderNum(); + } + viewHolder.tvOrderNo.setText(String.valueOf(ticketOrderNum)); + + DishAdapter adapter = new DishAdapter(); + /*List dishList = new ArrayList<>(); + for (int i = 0; i < tickets.size(); i ++) { + for (int j = 0; j < tickets.get(i).getDetail().size(); j ++) { + dishList.add(tickets.get(i).getDetail().get(j)); + } + }*/ + + + adapter.clean(); + adapter.add(ticket.getDetail()); + //adapter.add(dishList); + viewHolder.gvMenu.setAdapter(adapter); + + viewHolder.flTicket.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + ((ListView) parent).performItemClick(v, position, 0); + + LogEventTracker.TapRecentOrderEvent(GaCategory.HOME, ticket.getOrderId()); + Intent intent = new Intent(context, TicketActivity.class); + String orderInfo = UiUtil.toStringGson(tickets.get(position)); + intent.putExtra("clicked_order", orderInfo); + + context.startActivity(intent); + } + }); + return convertView; + } + + public void add(List tickets) { + this.tickets = tickets; + } + public void addItem(List tickets, TextView tvOtherView) { + this.tickets = tickets; + // Todo : 3개 초과의 경우 처리하기 + if (tickets.size() <= 3) { + hideViewAll(tvOtherView); + } else { + showViewAll(tvOtherView); + } + } + + public void showViewAll(TextView tvOtherView) { + tvOtherView.setVisibility(View.VISIBLE); + } + + public void hideViewAll(TextView tvOtherView) { + tvOtherView.setVisibility(View.INVISIBLE); + } + + public void addItemTop(OrderResData ticket) { + // Todo : 3개 초과의 경우 처리하기 + if (tickets.size() < 3) { + tickets.add(0, ticket); + } else { + tickets.clear(); + tickets.add(ticket); + } + } + + public void clean() { + if (tickets != null) { + tickets.clear(); + } + } + + + public class TicketViewHolder { + + public FrameLayout flTicket; + public TextView tvOrderDate; + public TextView tvTicketPrice; + public GridView gvMenu; + // adapter + + public LinearLayout llProcessState; + public TextView tvOrderNo; + + public ImageView ivPayment; + public TextView tvPayment; + + public ImageView ivReceive; + public TextView tvReceive; + + public ImageView ivMaking; + public TextView tvMaking; + + public ImageView ivComplete; + public TextView tvComplete; + + public View viewStateLineToInCook; + public View viewStateLineToReady; + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/home/model/Menu.java b/app/src/main/java/net/bluehack/kiosk/home/model/Menu.java new file mode 100644 index 0000000..2ade7bf --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/model/Menu.java @@ -0,0 +1,72 @@ +package net.bluehack.kiosk.home.model; + +import java.util.List; + +public class Menu { + + String menu; + String image; + int count; + + int point; + int price; + List options; + + public Menu() { + } + + // Fixme : UI Dummy를 위한 생성자로 삭제 + public Menu(String menu, String image, int count) { + this.menu = menu; + this.image = image; + this.count = count; + } + + public String getMenu() { + return menu; + } + + public void setMenu(String menu) { + this.menu = menu; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public int getPoint() { + return point; + } + + public void setPoint(int point) { + this.point = point; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public List getOptions() { + return options; + } + + public void setOptions(List options) { + this.options = options; + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/home/model/Store.java b/app/src/main/java/net/bluehack/kiosk/home/model/Store.java new file mode 100644 index 0000000..95d27ac --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/model/Store.java @@ -0,0 +1,41 @@ +package net.bluehack.kiosk.home.model; + +public class Store { + + String name; + String address; + String image; + + public Store() { + } + + public Store(String name, String address, String image) { + this.name = name; + this.address = address; + this.image = image; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/home/model/Ticket.java b/app/src/main/java/net/bluehack/kiosk/home/model/Ticket.java new file mode 100644 index 0000000..8459194 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/model/Ticket.java @@ -0,0 +1,126 @@ +package net.bluehack.kiosk.home.model; + +import java.util.List; + +public class Ticket { + + public enum State { + Payment, + Prepare, + InCook, + Ready, + Expire + } + + ; + + public static final int PAYMENT = 1; + public static final int RECEIVE = 2; + public static final int MAKING = 3; + public static final int COMPLETE = 4; + public static final int EXPIRE = 0; + + int state; + + String orderNo; + String date; + String time; + String price; + + List menus; + + Store store; + + public Ticket() { + } + + // Fixme : 기본 생성자로만 처리하기 + public Ticket(int state, String orderNo, + String date, String time, + String price, List menus) { + this.state = state; + this.orderNo = orderNo; + this.date = date; + this.time = time; + this.price = price; + this.menus = menus; + } + + public static int getPAYMENT() { + return PAYMENT; + } + + public static int getRECEIVE() { + return RECEIVE; + } + + public static int getMAKING() { + return MAKING; + } + + public static int getCOMPLETE() { + return COMPLETE; + } + + public static int getEXPIRE() { + return EXPIRE; + } + + public int getState() { + return state; + } + + public void setState(int state) { + this.state = state; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public List getMenus() { + return menus; + } + + public void setMenus(List menus) { + this.menus = menus; + } + + public Store getStore() { + return store; + } + + public void setStore(Store store) { + this.store = store; + } + + +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/home/ticket/TicketActivity.java b/app/src/main/java/net/bluehack/kiosk/home/ticket/TicketActivity.java new file mode 100644 index 0000000..7629fd1 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/home/ticket/TicketActivity.java @@ -0,0 +1,436 @@ +package net.bluehack.kiosk.home.ticket; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; +import com.google.gson.Gson; + +import android.content.Context; +import android.content.Intent; +import android.support.v4.content.ContextCompat; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.home.DishDetailAdapter; +import net.bluehack.kiosk.home.HomeActivity; +import net.bluehack.kiosk.home.model.Ticket; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.payment.PaymentActivity; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderReqDetail; +import io.swagger.client.model.AddOrderReqOption; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.OrderResData; + +public class TicketActivity extends BaseActivity { + + private static final String TAG = makeLogTag(TicketActivity.class); + + Context context; + // status + FrameLayout flStatus; + TextView tvOrderNo; + LinearLayout lvTicket; + GridView gvMenu; + + ImageView ivPayment; + TextView tvPayment; + ImageView ivReceive; + TextView tvReceive; + ImageView ivMaking; + TextView tvMaking; + ImageView ivComplete; + TextView tvComplete; + + TextView tvTitle; + ImageView ivCart; + TextView tvDate; + TextView tvStore; + TextView tvPoint; + TextView tvMethodPayment; + TextView tvTotal; + TextView tv_reorder; + TextView menu_cart_tv; + + ListView lvMenu; + DishDetailAdapter adapter; + + TextView tv_impossible_reorder; + FrameLayout fl_sold_out; + + TextView ticket_tv_subtotal_price; + TextView ticket_tv_tax_price; + TextView ticket_tv_usepoint_price; + View viewStateLineToInCook; + View viewStateLineToReady; + + + private ArrayList reorderMenuList = new ArrayList<>(); + + private LinearLayout progress_ll; + private ImageView progress_iv; + private boolean isCheckedGoHome = false; + + int userGetPoints = 0; + //TODO: FIXME =>testcode: OrderResData의 response 파라미터에 tax를 추가해야함 + double totalTax = 0.00; + double totalPrice = 0.00; + double subTotal = 0.00; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + context = this; + + setContentView(R.layout.activity_ticket); + + flStatus = (FrameLayout) findViewById(R.id.flStatus); + + ivPayment = (ImageView) findViewById(R.id.ivPayment); + tvPayment = (TextView) findViewById(R.id.tvPayment); + + ivReceive = (ImageView) findViewById(R.id.ivReceive); + tvReceive = (TextView) findViewById(R.id.tvReceive); + + ivMaking = (ImageView) findViewById(R.id.ivMaking); + tvMaking = (TextView) findViewById(R.id.tvMaking); + + ivComplete = (ImageView) findViewById(R.id.ivComplete); + tvComplete = (TextView) findViewById(R.id.tvComplete); + + + tvOrderNo = (TextView) findViewById(R.id.tvOrderNo); + lvTicket = (LinearLayout) findViewById(R.id.lvTicket); + gvMenu = (GridView) findViewById(R.id.gvMenu); + gvMenu.setVisibility(View.GONE); + + tvTitle = (TextView) findViewById(R.id.tvTitle); + ivCart = (ImageView) findViewById(R.id.ivCart); + tvDate = (TextView) findViewById(R.id.tvDate); + tvStore = (TextView) findViewById(R.id.tvStore); + tvPoint = (TextView) findViewById(R.id.tvPoint); + tvMethodPayment = (TextView) findViewById(R.id.tvMethodPayment); + tvTotal = (TextView) findViewById(R.id.tvTotal); + tv_reorder = (TextView) findViewById(R.id.tv_reorder); + menu_cart_tv = (TextView) findViewById(R.id.menu_cart_tv); + + lvMenu = (ListView) findViewById(R.id.lvDishDetail); + adapter = new DishDetailAdapter(); + lvMenu.setAdapter(adapter); + lvMenu.setSelector(R.drawable.listview_non_selector); + + progress_ll = (LinearLayout) findViewById(R.id.progress_ll); + progress_iv = (ImageView) findViewById(R.id.progress_iv); + + tv_impossible_reorder = (TextView) findViewById(R.id.tv_impossible_reorder); + fl_sold_out = (FrameLayout) findViewById(R.id.fl_sold_out); + + ticket_tv_subtotal_price = (TextView) findViewById(R.id.ticket_tv_subtotal_price); + ticket_tv_tax_price = (TextView) findViewById(R.id.ticket_tv_tax_price); + ticket_tv_usepoint_price = (TextView) findViewById(R.id.ticket_tv_usepoint_price); + + viewStateLineToInCook = (View) findViewById(R.id.viewStateLineToInCook); + viewStateLineToReady = (View) findViewById(R.id.viewStateLineToReady); + + final Intent intent = getIntent(); + + if (intent.getExtras() != null) { + + fl_sold_out.setVisibility(View.GONE); + tv_impossible_reorder.setVisibility(View.GONE); + tv_reorder.setVisibility(View.VISIBLE); + + String impossible_order = "false"; + if (intent.getExtras().getString("impossible_order") != null) { + + impossible_order = intent.getExtras().getString("impossible_order"); + + if (impossible_order.equals("true")) { + fl_sold_out.setVisibility(View.VISIBLE); + tv_reorder.setVisibility(View.GONE); + tv_impossible_reorder.setVisibility(View.VISIBLE); + } + } + + if (intent.getExtras().getString("isCheckedGoHome") != null) { + + if (intent.getExtras().getString("isCheckedGoHome").equals("true")) { + isCheckedGoHome = true; + } + } + + String order_info = intent.getExtras().getString("clicked_order"); + //LOGD(TAG, UiUtil.toStringGson(order_info)); + + Gson gson = new Gson(); + OrderResData orderItem = gson.fromJson(order_info, OrderResData.class); + LOGD(TAG, UiUtil.toStringGson(orderItem)); + + if (orderItem != null) { + + if (orderItem.getAddPoints() != null) { + userGetPoints = orderItem.getAddPoints(); + } + + // update UI + updateTicket(orderItem); + + //TODO : fixme => orderItem 중에 서버에서 받아오는 데이터 필드가 부족하여 추가해야함(ex. 특히 option_type) + for (int i = 0; i < orderItem.getDetail().size(); i ++) { + CartMenuItem cartMenuItem = new CartMenuItem(); + List cartMenuOptionlist = new ArrayList<>(); + + cartMenuItem.setMenu_id(orderItem.getDetail().get(i).getDetailMenuId()); + cartMenuItem.setMenu_image(orderItem.getDetail().get(i).getDetailFileId()); + cartMenuItem.setMenu_name(orderItem.getDetail().get(i).getDetailMenuName()); + cartMenuItem.setMenu_price(String.valueOf(orderItem.getDetail().get(i).getDetailPrice())); + + for (int j = 0; j < orderItem.getDetail().get(i).getOption().size(); j ++) { + CartMenuOptionItem cartMenuOptionItem = new CartMenuOptionItem(); + cartMenuOptionItem.setMenu_option_id(orderItem.getDetail().get(i).getOption().get(j).getOptionMenuId()); + cartMenuOptionItem.setMenu_option_name(orderItem.getDetail().get(i).getOption().get(j).getOptionMenuName()); + cartMenuOptionItem.setMenu_option_price(String.valueOf(orderItem.getDetail().get(i).getOption().get(j).getOptionPrice())); + + cartMenuOptionlist.add(cartMenuOptionItem); + } + cartMenuItem.setCartMenuOptionItems(cartMenuOptionlist); + + reorderMenuList.add(cartMenuItem); + } + + } else { + // 종료 + } + } + + ivCart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.CartBtnEvent(GaCategory.ORDERHISTORYDETAIL); + Intent intent = new Intent(context, CartMenuActivity.class); + startActivity(intent); + } + }); + + tv_reorder.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.OrderBtnEvent(GaCategory.ORDERHISTORYDETAIL, reorderMenuList); + Intent paymentIntent = new Intent(context, PaymentActivity.class); + paymentIntent.putExtra("reorderMenuList", reorderMenuList); + startActivity(paymentIntent); + } + }); + } + + private void updateTicket(OrderResData ticket) { + LOGD(TAG, UiUtil.toStringGson(ticket)); + + if (ticket == null) { + return; + } + + //TODO: fixme => getorderstatus + int ticketStatus = 0; + int ticketOrderNum = 0; + + if (ticket.getOrderStatus() != null) { + ticketStatus = ticket.getOrderStatus(); + + ticketStatusTextColorInit(); + switch (ticket.getCookStatus()) { + case Ticket.PAYMENT: + ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + tvPayment.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + break; + case Ticket.RECEIVE: + ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + tvReceive.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + break; + case Ticket.MAKING: + ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + + tvMaking.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.drawable.img_state_line_dot)); + break; + case Ticket.COMPLETE: + ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_finish)); + ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + + tvComplete.setTextColor(ContextCompat.getColor(context, R.color.color_37)); + break; + + default: + ivPayment.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_ing)); + ivReceive.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + ivMaking.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + ivComplete.setBackground( + UiUtil.getDrawable(context, R.drawable.img_process_yet)); + break; + } + } + + if (ticket.getOrderNum() != null) { + ticketOrderNum = ticket.getOrderNum(); + } + + if (ticketStatus == Ticket.EXPIRE) { + flStatus.setVisibility(View.GONE); + } else { + lvTicket.setVisibility(View.INVISIBLE); + flStatus.setVisibility(View.VISIBLE); + + tvOrderNo.setText(String.valueOf(ticketOrderNum)); + } + + tvTitle.setText(String.valueOf(ticketOrderNum)); + tvDate.setText(ticket.getRegidate()); + tvStore.setText(KioskPreference.getInstance().getStoreInfo().getStore()); + tvPoint.setText("+ " + String.valueOf(userGetPoints) + "P"); + + + totalPrice = Double.valueOf(String.valueOf(ticket.getPrice())); + totalPrice = (int) (totalPrice * 100) / 100.0; + totalTax = Double.valueOf(String.valueOf(ticket.getTax())); + totalTax = (int) (totalTax * 100) / 100.0; + + BigDecimal dTotalPrice = new BigDecimal(String.valueOf(totalPrice)); + BigDecimal dTotalTax = new BigDecimal(String.valueOf(totalTax)); + BigDecimal dSubTotal = dTotalPrice.subtract(dTotalTax); + subTotal = Double.parseDouble(String.valueOf(dSubTotal)); + + ticket_tv_subtotal_price.setText("$" + String.valueOf(subTotal)); + ticket_tv_tax_price.setText("$" + String.valueOf(totalTax)); + + if (ticket.getPoints() == null || ticket.getPoints() == 0) { + ticket_tv_usepoint_price.setText(String.valueOf(ticket.getPoints()) + "P"); + } else { + ticket_tv_usepoint_price.setText("-" + String.valueOf(ticket.getPoints()) + "P"); + } + + String paymethod = getResources().getString(R.string.payment_methods_card); + if (ticket.getPaymethod() != null) { + if (ticket.getPaymethod().equals("0,1,0")) { + paymethod = getResources().getString(R.string.payment_methods_card); + } else if (ticket.getPaymethod().equals("0,0,1")) { + paymethod = getResources().getString(R.string.payment_methods_point); + } else if (ticket.getPaymethod().equals("0,1,1")) { + paymethod = getResources().getString(R.string.payment_methods_card_and_point); + } + + + } + tvMethodPayment.setText(paymethod); + tvTotal.setText("$" + String.valueOf(ticket.getPrice())); + + adapter.addList(ticket.getDetail()); + + UiUtil.drawListViewFitHeight(lvMenu, adapter); + } + + private void ticketStatusTextColorInit() { + tvPayment.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + tvReceive.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + tvMaking.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + tvComplete.setTextColor(ContextCompat.getColor(context, R.color.color_34)); + + viewStateLineToInCook.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + viewStateLineToReady.setBackground(UiUtil.getDrawable(context, R.color.color_49)); + } + + @Override + protected void onPostResume() { + super.onPostResume(); + + if (KioskPreference.getInstance().getCartInfo() != null) { + + if (KioskPreference.getInstance().getCartInfo().size() != 0) { + menu_cart_tv.setVisibility(View.VISIBLE); + } else { + menu_cart_tv.setVisibility(View.INVISIBLE); + } + } + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + + if (reorderMenuList != null) { + reorderMenuList.clear(); + } + + if (isCheckedGoHome) { + Intent intent = new Intent(context, HomeActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/log/DeviceInfo.java b/app/src/main/java/net/bluehack/kiosk/log/DeviceInfo.java new file mode 100644 index 0000000..4851fac --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/log/DeviceInfo.java @@ -0,0 +1,12 @@ +package net.bluehack.kiosk.log; + +public class DeviceInfo { + + public final static String USER_ID = "user_id"; + public final static String USER_APP_VERSION_CODE_NAME = "user_app_version_code_name"; + public final static String USER_APP_VERSION_RELEASE = "user_app_version_release"; + public final static String USER_DEVICE = "user_device"; + public final static String USER_MODEL = "user_model"; + public final static String USER_PRODUCT = "user_product"; + public final static String USER_BRAND = "user_brand"; +} diff --git a/app/src/main/java/net/bluehack/kiosk/log/GaCategory.java b/app/src/main/java/net/bluehack/kiosk/log/GaCategory.java new file mode 100644 index 0000000..251b9e7 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/log/GaCategory.java @@ -0,0 +1,19 @@ +package net.bluehack.kiosk.log; + +public class GaCategory { + public static final String LOGIN = "Login"; + public static final String STORE = "Store"; + public static final String HOME = "Home"; + public static final String SLIDEMENU = "Slidemenu"; + public static final String MYINFO = "Myinfo"; + public static final String ORDERHISTORY = "Orderhistory"; + public static final String ORDERHISTORYDETAIL = "Orderhistorydetail"; + public static final String CART = "Cart"; + public static final String CONTACT_US = "Contact_us"; + public static final String CATEGORY = "Category"; + public static final String MENU = "Menu"; + public static final String OPTION = "Option"; + public static final String PAYMENT = "Payment"; + public static final String PAYMENT_WEB = "Payment_web"; + public static final String POP_UP = "Pop_up"; +} diff --git a/app/src/main/java/net/bluehack/kiosk/log/LogEvent.java b/app/src/main/java/net/bluehack/kiosk/log/LogEvent.java new file mode 100644 index 0000000..bccb891 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/log/LogEvent.java @@ -0,0 +1,32 @@ +package net.bluehack.kiosk.log; + +public class LogEvent { + public static final String USER_PROFILE = "user_profile"; + public static final String LOGIN_BTN = "login_btn"; + public static final String TAP_STORE = "tap_store"; + public static final String NAV_MENU_BTN = "nav_menu_btn"; + public static final String CHANGE_STORE_BTN = "change_store_btn"; + public static final String TAP_RECENT_ORDER = "tap_recent_order"; + public static final String VIEW_ALL_BTN = "view_all_btn"; + public static final String MOBILE_ORDER_BTN = "mobile_order_btn"; + public static final String MY_INFO_BTN = "my_info_btn"; + public static final String STORE_BTN = "store_btn"; + public static final String ORDER_HISTORY_BTN = "order_history_btn"; + public static final String CART_BTN = "cart_btn"; + public static final String CONTACTUS_BTN = "contactus_btn"; + public static final String LOGOUT_BTN = "logout_btn"; + public static final String ORDER_HISTORY = "order_history"; + public static final String TAP_ADD_CART = "tap_add_cart"; + public static final String ORDER_BTN = "order_btn"; + public static final String REMOVE_BTN = "remove_btn"; + public static final String CONTACT_US = "contact_us"; + public static final String TAP_CATEGORY = "tap_category"; + public static final String TAP_MENU = "tap_menu"; + public static final String ON_USEPOINTS = "on_usepoints"; + public static final String OFF_USEPOINTS = "off_usepoints"; + public static final String PAYMENT_BTN = "payment_btn"; + public static final String OPEN_WEBVIEW = "open_webview"; + public static final String CLOSE_WEBVIEW = "close_webview"; + public static final String OPEN_POPUP = "open_popup"; + public static final String CLOSE_POPUP = "order_history_btn"; +} diff --git a/app/src/main/java/net/bluehack/kiosk/log/LogEventKey.java b/app/src/main/java/net/bluehack/kiosk/log/LogEventKey.java new file mode 100644 index 0000000..9f08b81 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/log/LogEventKey.java @@ -0,0 +1,16 @@ +package net.bluehack.kiosk.log; + +public class LogEventKey { + public static final String TO_STORE = "to_store"; + public static final String FROM_STORE = "from_store"; + public static final String RECENT_ORDER = "recent_order"; + public static final String APP_LOCATION = "app_location"; + public static final String ORDER_ID = "order_id"; + public static final String ORDER_DETAIL = "order_detail"; + public static final String MENU = "menu"; + public static final String PHONE_NUM = "to_store"; + public static final String CATEGORY = "category"; + public static final String USE_POINTS = "use_points"; + public static final String POPUP_NAME = "popup_name"; + public static final String BUTTON_LABEL = "button_label"; +} diff --git a/app/src/main/java/net/bluehack/kiosk/log/LogEventTracker.java b/app/src/main/java/net/bluehack/kiosk/log/LogEventTracker.java new file mode 100644 index 0000000..bb8cb3d --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/log/LogEventTracker.java @@ -0,0 +1,368 @@ +package net.bluehack.kiosk.log; + +import android.os.Build; +import android.os.Bundle; + +import com.google.android.gms.analytics.HitBuilders; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.Iterator; + +import io.swagger.client.model.AddOrderReq; + +public class LogEventTracker { + + public static void userDeviceInfo(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put(DeviceInfo.USER_APP_VERSION_CODE_NAME, Build.VERSION.CODENAME); + props.put(DeviceInfo.USER_APP_VERSION_RELEASE, Build.VERSION.RELEASE); + props.put(DeviceInfo.USER_DEVICE, Build.DEVICE); + props.put(DeviceInfo.USER_MODEL, Build.MODEL); + props.put(DeviceInfo.USER_PRODUCT, Build.PRODUCT); + props.put(DeviceInfo.USER_BRAND, Build.BRAND); + + pushEvent(gaCategory, LogEvent.USER_PROFILE, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void LoginBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.LOGIN_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void ViewAllBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + + pushEvent(gaCategory, LogEvent.VIEW_ALL_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void NavMenuBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.NAV_MENU_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void MoblieOrderBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.MOBILE_ORDER_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void SlideMyInfoBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.MY_INFO_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void SlideStoreBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + + pushEvent(gaCategory, LogEvent.STORE_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void SlideOrderHistoryBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + + pushEvent(gaCategory, LogEvent.ORDER_HISTORY_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void SlideContactusBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("",""); + + pushEvent(gaCategory, LogEvent.CONTACTUS_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void LogoutBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("",""); + + pushEvent(gaCategory, LogEvent.LOGOUT_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void OrderHistoryEvent(String gaCategory, String order_id) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.ORDER_ID, order_id); + props.put(LogEventKey.APP_LOCATION, gaCategory); + + pushEvent(gaCategory, LogEvent.ORDER_HISTORY, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void TapAddCartEvent(String gaCategory, CartMenuItem order_detail) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + props.put(LogEventKey.ORDER_DETAIL, UiUtil.toStringGson(order_detail)); + + pushEvent(gaCategory, LogEvent.TAP_ADD_CART, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void CartBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + + pushEvent(gaCategory, LogEvent.CART_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void ContactUsEvent(String gaCategory, String phone_num) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.PHONE_NUM, phone_num); + + pushEvent(gaCategory, LogEvent.CONTACT_US, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void TapCategoryEvent(String gaCategory, String category_name) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.CATEGORY, category_name); + + pushEvent(gaCategory, LogEvent.TAP_CATEGORY, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void TapMenuEvent(String gaCategory, String menu_id) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.MENU, menu_id); + + pushEvent(gaCategory, LogEvent.TAP_MENU, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void OrderBtnEvent(String gaCategory, ArrayList cartMenuItems) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + props.put(LogEventKey.ORDER_DETAIL, UiUtil.toStringGson(cartMenuItems)); + + pushEvent(gaCategory, LogEvent.ORDER_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void RemoveBtnEvent(String gaCategory, String menu_id) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.APP_LOCATION, gaCategory); + props.put(LogEventKey.MENU, menu_id); + + pushEvent(gaCategory, LogEvent.REMOVE_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void TapStoreEvent(String gaCategory, String store_name) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.TO_STORE, store_name); + + pushEvent(gaCategory, LogEvent.TAP_STORE, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void ChangeStoreEvent(String gaCategory, String store_name) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.FROM_STORE, store_name); + + pushEvent(gaCategory, LogEvent.CHANGE_STORE_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void TapRecentOrderEvent(String gaCategory, String order_id) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.RECENT_ORDER, order_id); + + pushEvent(gaCategory, LogEvent.TAP_RECENT_ORDER, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void PaymentBtnEvent(String gaCategory, AddOrderReq orderItems) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.ORDER_DETAIL, UiUtil.toStringGson(orderItems)); + + pushEvent(gaCategory, LogEvent.PAYMENT_BTN, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void OnUsePointsBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.ON_USEPOINTS, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void OffUsePointsBtnEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.OFF_USEPOINTS, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void OpenWebViewEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.OPEN_WEBVIEW, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void CloseWebViewEvent(String gaCategory) { + try { + JSONObject props = new JSONObject(); + props.put("", ""); + + pushEvent(gaCategory, LogEvent.CLOSE_WEBVIEW, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + + public static void OpenPopupEvent(String gaCategory, String popup_name) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.POPUP_NAME, popup_name); + + pushEvent(gaCategory, LogEvent.OPEN_POPUP, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + public static void ClosePopupEvent(String gaCategory, String popup_name, String button_label) { + try { + JSONObject props = new JSONObject(); + props.put(LogEventKey.POPUP_NAME, popup_name); + props.put(LogEventKey.BUTTON_LABEL, button_label); + + pushEvent(gaCategory, LogEvent.CLOSE_POPUP, props); + } catch (JSONException e) { + //LOGE(TAG, "Unable to add properties to JSONObject", e); + } + } + + + public static void pushEvent(String gaCategory, String event, JSONObject properties) { + //Firebase log event + Bundle bundle = new Bundle(); + Iterator keys = properties.keys(); + while (keys.hasNext()) { + String key = keys.next(); + try { + Object value = properties.get(key); + if (value instanceof String) { + bundle.putString(key, (String) value); + } else if (value instanceof Long) { + bundle.putLong(key, (Long) value); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + ApplicationLoader.getFirebaseAnalytics().logEvent(event, bundle); + ApplicationLoader.getGaTracker().send(new HitBuilders.EventBuilder() + .setCategory(gaCategory) + .setAction(event) + .setLabel(ApplicationLoader.getUserId()) + .build()); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/login/AdminActivity.java b/app/src/main/java/net/bluehack/kiosk/login/AdminActivity.java new file mode 100644 index 0000000..3b0d7c3 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/login/AdminActivity.java @@ -0,0 +1,67 @@ +package net.bluehack.kiosk.login; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.Color; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; + +import io.swagger.client.api.BasePath; + +public class AdminActivity extends BaseActivity { + + private Context context; + private EditText admin_url_et; + private Button admin_url_btn; + private String url = ""; + + public AdminActivity(){} + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_admin); + + context = this; + + admin_url_btn = (Button) findViewById(R.id.admin_url_btn); + admin_url_et = (EditText) findViewById(R.id.admin_url_et); + admin_url_et.setTextColor(Color.BLACK); + + admin_url_et.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + url = s.toString(); + } + }); + admin_url_et.setText(url); + admin_url_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + BasePath.getInstance().setBasePath(url); + Intent intent = new Intent(context, LoginActivity.class); + startActivity(intent); + finish(); + } + }); + } + +} diff --git a/app/src/main/java/net/bluehack/kiosk/login/LoginActivity.java b/app/src/main/java/net/bluehack/kiosk/login/LoginActivity.java new file mode 100644 index 0000000..9263ff3 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/login/LoginActivity.java @@ -0,0 +1,272 @@ +package net.bluehack.kiosk.login; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; +import com.google.firebase.iid.FirebaseInstanceId; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; +import android.os.Build; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.home.HomeActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.store.StoreActivity; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiInvoker; +import io.swagger.client.api.AccountApi; +import io.swagger.client.model.LoginReq; +import io.swagger.client.model.LoginRes; +import okhttp3.Response; + +public class LoginActivity extends BaseActivity { + + private static final String TAG = makeLogTag(LoginActivity.class); + private Button login_btn; + private EditText login_text_id; + private EditText login_text_pw; + private TextView login_underline_text_id; + private TextView login_underline_text_pw; + private LoginReq loginReq; + private String loginIdText = ""; + private String loginPwText = ""; + private LinearLayout login_ll_admin; + private Context context; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + + context = this; + + //auto login + if (checkedAutoLogin()) { + if (KioskPreference.getInstance().getStoreInfo() == null) { + Intent intent = new Intent(LoginActivity.this, StoreActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + + } else { + Intent intent = new Intent(LoginActivity.this, HomeActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } + } + + login_btn = (Button) findViewById(R.id.login_btn); + login_text_id = (EditText) findViewById(R.id.login_text_id); + login_text_pw = (EditText) findViewById(R.id.login_text_pw); + login_underline_text_id = (TextView) findViewById(R.id.login_underline_text_id); + login_underline_text_pw = (TextView) findViewById(R.id.login_underline_text_pw); + login_ll_admin = (LinearLayout) findViewById(R.id.login_ll_admin); + + login_ll_admin.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + Intent adminIntent = new Intent(LoginActivity.this, AdminActivity.class); + adminIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(adminIntent); + finish(); + return false; + } + }); + login_text_id.setOnFocusChangeListener(new View.OnFocusChangeListener() { + @Override + public void onFocusChange(View v, boolean hasFocus) { + if (hasFocus) { + login_underline_text_id.setBackgroundColor(getColor(getApplicationContext(), R.color.color_09)); + login_underline_text_pw.setBackgroundColor(getColor(getApplicationContext(), R.color.color_04)); + } + } + }); + login_text_id.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + + loginIdText = s.toString(); + + if (loginPwText.length() <= 0 && loginIdText.length() <= 0) { + login_btn.setBackground(UiUtil.getDrawable(context, R.drawable.btn_type1_click_event)); + } + } + }); + + login_text_pw.setOnFocusChangeListener(new View.OnFocusChangeListener() { + @Override + public void onFocusChange(View v, boolean hasFocus) { + if (hasFocus) { + login_underline_text_pw.setBackgroundColor(getColor(getApplicationContext(), R.color.color_09)); + login_underline_text_id.setBackgroundColor(getColor(getApplicationContext(), R.color.color_04)); + } + } + }); + login_text_pw.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + login_btn.setBackground(UiUtil.getDrawable(context, R.drawable.btn_type1_click_event)); + loginPwText = s.toString(); + + if (loginPwText.length() <= 0) { + login_btn.setBackgroundColor(getColor(getApplicationContext(), R.color.color_07)); + } + if (loginPwText.length() <= 0 && loginIdText.length() <= 0) { + login_btn.setBackgroundColor(getColor(getApplicationContext(), R.color.color_07)); + } + } + }); + + login_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.LoginBtnEvent(GaCategory.LOGIN); + String push_token = FirebaseInstanceId.getInstance().getToken(); + + loginReq = new LoginReq(); + //TODO: fixme => TEST ACCOUNT LOGIN + if (loginIdText.length() == 0 ) { + loginReq.setAccountId("test@gmail.com"); + } else { + loginReq.setAccountId(loginIdText); + } + if (loginPwText.length() == 0 ) { + loginReq.setPasswd("1111"); + } else { + loginReq.setPasswd(loginPwText); + } + + loginReq.setPushToken(push_token); + + LOGD(TAG, "loginReq info : " + loginIdText + "," + loginPwText); + LOGD(TAG, "push_token : " + push_token); + + doLogin(context, loginReq); + } + }); + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + } + + public static int getColor(Context context, int id) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + return context.getColor(id); + } else { + //noinspection deprecation + return context.getResources().getColor(id); + } + } + + private void doLogin(final Context context, final LoginReq loginReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().accountLoginPost(context, loginReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + LoginRes loginRes = (LoginRes) result; + + if (loginRes.getResponseStatus() != null && loginRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + //set preference + KioskPreference.getInstance().setLoginInfo(loginRes.getData().get(0)); + LogEventTracker.userDeviceInfo(GaCategory.LOGIN); + + Intent intent = new Intent(LoginActivity.this, StoreActivity.class); + startActivity(intent); + finish(); + + } else { + Toast.makeText(getApplicationContext(), getResources().getString(R.string.login_failed), Toast.LENGTH_SHORT).show(); + if (loginIdText.length() > 0 || loginPwText.length() > 0) { + loginIdText = ""; + loginPwText = ""; + login_text_id.setText(""); + login_text_pw.setText(""); + login_text_id.requestFocus(); + } + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + private boolean checkedAutoLogin() { + if (KioskPreference.getInstance().getLoginInfo() != null) { + return true; + } else { + return false; + } + } + + + @Override + public void onBackPressed() { + super.onBackPressed(); + finish(); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/main/MainActivity.java b/app/src/main/java/net/bluehack/kiosk/main/MainActivity.java deleted file mode 100644 index 8d13c71..0000000 --- a/app/src/main/java/net/bluehack/kiosk/main/MainActivity.java +++ /dev/null @@ -1,156 +0,0 @@ -package net.bluehack.kiosk.main; - - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.support.design.widget.NavigationView; -import android.support.v4.view.GravityCompat; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.view.Gravity; -import android.view.MenuItem; -import android.view.View; -import android.widget.ImageView; -import android.widget.Toast; - -import com.synnapps.carouselview.CarouselView; -import com.synnapps.carouselview.ViewListener; - -import net.bluehack.kiosk.R; -import net.bluehack.kiosk.store.StoreActivity; - -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class MainActivity extends AppCompatActivity { - - private static final String TAG = makeLogTag(MainActivity.class); - private Context context; - private DrawerLayout drawerLayout; - private NavigationView navigationView; - private CarouselView carouselView; - private int[] carouselImgs = {R.drawable.img_slidemenu_promotion, R.drawable.img_slidemenu_promotion, R.drawable.img_slidemenu_promotion, R.drawable.img_slidemenu_promotion}; - - private RecyclerView recyclerView; - private RecyclerView.LayoutManager layoutManager; - private ImageView orderBtn; - private RecentCardAdapter recentCardAdapter = null; - private final String query = "b_read_data"; - - - @Override - protected void onStart() { - super.onStart(); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.activity_main); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - ActionBar actionBar = getSupportActionBar(); - actionBar.setHomeAsUpIndicator(R.drawable.btn_main_menu_nor); - actionBar.setDisplayHomeAsUpEnabled(true); - - orderBtn = (ImageView) findViewById(R.id.order_btn); - drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - carouselView = (CarouselView) findViewById(R.id.carousel_view); - //recyclerView = (RecyclerView) findViewById(R.id.recent_menu_list); - //recyclerView.setHasFixedSize(true); - - //layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); - //recyclerView.setLayoutManager(layoutManager); - - //recentCardAdapter = new RecentCardAdapter(); - //recyclerView.setAdapter(recentCardAdapter); - //recentCardAdapter.notifyDataSetChanged(); - - carouselView.setPageCount(carouselImgs.length); - carouselView.setSlideInterval(2000); - carouselView.setViewListener(new ViewListener() { - @Override - public View setViewForPosition(int position) { - View carouselListItem = getLayoutInflater().inflate(R.layout.carousel_list_item, null); - ImageView carouselItemImg = (ImageView) carouselListItem.findViewById(R.id.carousel_item_img); - - carouselItemImg.setImageResource(carouselImgs[position]); - carouselView.setIndicatorGravity(Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM); - - return carouselListItem; - } - }); - - navigationView = (NavigationView) findViewById(R.id.navigation_view); - navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { - @Override - public boolean onNavigationItemSelected(MenuItem menuItem) { - menuItem.setChecked(true); - drawerLayout.closeDrawers(); - - int id = menuItem.getItemId(); - switch (id) { - case R.id.nav_item_01: - Toast.makeText(MainActivity.this, menuItem.getTitle(), Toast.LENGTH_LONG).show(); - break; - - case R.id.nav_item_02: - Toast.makeText(MainActivity.this, menuItem.getTitle(), Toast.LENGTH_LONG).show(); - break; - - case R.id.nav_item_03: - Toast.makeText(MainActivity.this, menuItem.getTitle(), Toast.LENGTH_LONG).show(); - break; - - case R.id.nav_item_04: - Toast.makeText(MainActivity.this, menuItem.getTitle(), Toast.LENGTH_LONG).show(); - break; - - case R.id.nav_item_05: - Toast.makeText(MainActivity.this, menuItem.getTitle(), Toast.LENGTH_LONG).show(); - break; - - } - - return true; - } - }); - - orderBtn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - //Toast.makeText(MainActivity.this, "test", Toast.LENGTH_LONG).show(); - - Intent intent = new Intent(MainActivity.this, StoreActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } - }); - - } - - - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - switch (id) { - case android.R.id.home: - drawerLayout.openDrawer(GravityCompat.START); - return true; - } - - return super.onOptionsItemSelected(item); - } - - - -} diff --git a/app/src/main/java/net/bluehack/kiosk/main/RecentCardAdapter.java b/app/src/main/java/net/bluehack/kiosk/main/RecentCardAdapter.java deleted file mode 100644 index 2bc649b..0000000 --- a/app/src/main/java/net/bluehack/kiosk/main/RecentCardAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.bluehack.kiosk.main; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - - -import net.bluehack.kiosk.R; -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class RecentCardAdapter extends RecyclerView.Adapter{ - - private static final String TAG = makeLogTag(RecentCardAdapter.class); - private Context context; - private final int img = R.drawable.btn_recent_menu_sample_01_nor; - - public RecentCardAdapter(){ - } - - /*public RecentCardAdapter(Context context) { - this.context = context; - }*/ - - @Override - public RecentCardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - - View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recent_menu_list_item, parent, false); - return new RecentCardViewHolder(v); - } - - @Override - public void onBindViewHolder(RecentCardViewHolder holder, int position) { - - /*LOGE(TAG, "menuItems count :"+ arrayList.get(position)); - - MenuDataItem menuItem = arrayList.get(position); - holder.imageView.setBackground(ContextCompat.getDrawable(context, img)); - holder.title.setText(menuItem.getName()); - holder.kind.setText(menuItem.getPrice());*/ - } - - @Override - public int getItemCount() { - /*if(this.arrayList != null) { - return this.arrayList.size(); - }else{ - return 0; - }*/ - return 0; - } - - @Override - public void onAttachedToRecyclerView(RecyclerView recyclerView) { - super.onAttachedToRecyclerView(recyclerView); - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/main/RecentCardViewHolder.java b/app/src/main/java/net/bluehack/kiosk/main/RecentCardViewHolder.java deleted file mode 100644 index 80e37f0..0000000 --- a/app/src/main/java/net/bluehack/kiosk/main/RecentCardViewHolder.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.bluehack.kiosk.main; - -import android.support.v7.widget.CardView; -import android.support.v7.widget.RecyclerView; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; - -import net.bluehack.kiosk.R; - -public class RecentCardViewHolder extends RecyclerView.ViewHolder { - - CardView cardView; - ImageView imageView; - TextView title; - TextView kind; - - public RecentCardViewHolder(View itemView) { - super(itemView); - - this.cardView = (CardView) itemView.findViewById(R.id.recent_menu_card_view); - this.imageView = (ImageView) itemView.findViewById(R.id.recent_menu_item_img); - this.title = (TextView) itemView.findViewById(R.id.recent_menu_title); - this.kind = (TextView) itemView.findViewById(R.id.recent_menu_kind); - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/main/RecentItem.java b/app/src/main/java/net/bluehack/kiosk/main/RecentItem.java deleted file mode 100644 index 95a8750..0000000 --- a/app/src/main/java/net/bluehack/kiosk/main/RecentItem.java +++ /dev/null @@ -1,78 +0,0 @@ -package net.bluehack.kiosk.main; - -public class RecentItem { - private String menu_idx; - private String category; - private String name; - private String calory; - private String price; - private String description; - private String barcode; - private String use_YN; - - public RecentItem(){} - - public String getMenu_idx() { - return menu_idx; - } - - public void setMenu_idx(String menu_idx) { - this.menu_idx = menu_idx; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCalory() { - return calory; - } - - public void setCalory(String calory) { - this.calory = calory; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getBarcode() { - return barcode; - } - - public void setBarcode(String barcode) { - this.barcode = barcode; - } - - public String getUse_YN() { - return use_YN; - } - - public void setUse_YN(String use_YN) { - this.use_YN = use_YN; - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/MenuActivity.java b/app/src/main/java/net/bluehack/kiosk/menu/MenuActivity.java new file mode 100644 index 0000000..fd34100 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/MenuActivity.java @@ -0,0 +1,177 @@ +package net.bluehack.kiosk.menu; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.google.gson.Gson; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.KioskPreference; + +import java.util.ArrayList; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.MenuReq; +import io.swagger.client.model.MenuRes; +import io.swagger.client.model.MenuResData; + +public class MenuActivity extends BaseActivity { + + private static final String TAG = makeLogTag(MenuActivity.class); + private Context context; + private TextView menu_toolbar_name; + private TextView menu_cart_tv; + private ImageView menu_cart; + private MenuAdapter menuAdapter; + private RecyclerView menuRecyclerView; + private RecyclerView.LayoutManager layoutManager; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_menu); + + context = this; + + menuRecyclerView = (RecyclerView) findViewById(R.id.menu_rv_list); + menu_toolbar_name = (TextView) findViewById(R.id.menu_toolbar_name); + menu_cart_tv = (TextView) findViewById(R.id.menu_cart_tv); + menu_cart = (ImageView) findViewById(R.id.menu_cart); + + layoutManager = new LinearLayoutManager(this); + menuAdapter = new MenuAdapter(context); + + menuRecyclerView.setHasFixedSize(true); + menuRecyclerView.setLayoutManager(layoutManager); + menuRecyclerView.setAdapter(menuAdapter); + + Intent intent = getIntent(); + String sub_category_id = intent.getExtras().getString("sub_category_id"); + String sub_category_name = intent.getExtras().getString("sub_category_name"); + intent.removeExtra("sub_category_id"); + intent.removeExtra("sub_category_name"); + LOGE(TAG, "sub_category_id : " + sub_category_id); + LOGE(TAG, "sub_category_name: " + sub_category_name); + + menu_toolbar_name.setText(sub_category_name); + + String store_id = ""; + if (KioskPreference.getInstance().getStoreInfo() != null) { + store_id = KioskPreference.getInstance().getStoreInfo().getStoreId(); + } + + MenuReq menuReq = new MenuReq(); + menuReq.setStoreId(store_id); + menuReq.setSubCategoryId(sub_category_id); + getMenuList(context, menuReq); + + menu_cart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.CartBtnEvent(GaCategory.MENU); + Intent cartIntent = new Intent(context, CartMenuActivity.class); + startActivity(cartIntent); + } + }); + } + + private void getMenuList(final Context context, final MenuReq menuReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().menuListPost(context, menuReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + MenuRes menuRes = (MenuRes) result; + + Gson gson = new Gson(); + LOGE(TAG, "menuRes result : " + gson.toJson(result)); + + if (menuRes.getResponseStatus() != null && menuRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + menuAdapter.clean(); + + ArrayList menuResDataItems = new ArrayList<>(); + + for (MenuResData item : menuRes.getData()) { + + MenuResData menuResDataItem = new MenuResData(); + menuResDataItem.setMenuId(item.getMenuId()); + menuResDataItem.setSubCategoryId(item.getSubCategoryId()); + menuResDataItem.setBarcode(item.getBarcode()); + menuResDataItem.setCalory(item.getCalory()); + menuResDataItem.setDescription(item.getDescription()); + menuResDataItem.setFileId(item.getFileId()); + menuResDataItem.setMItem(item.getMItem()); + menuResDataItem.setMRegidate(item.getMRegidate()); + menuResDataItem.setMType(item.getMType()); + menuResDataItem.setPoints(item.getPoints()); + menuResDataItem.setPrice(item.getPrice()); + menuResDataItem.setUseYN(item.getUseYN()); + menuResDataItem.setCalory(item.getCalory()); + + menuResDataItems.add(menuResDataItem); + } + menuAdapter.addItem(menuResDataItems); + menuAdapter.notifyDataSetChanged(); + + } else { + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.menu_not_found_list), Toast.LENGTH_SHORT).show(); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + @Override + protected void onResume() { + super.onResume(); + + if (KioskPreference.getInstance().getCartInfo() != null) { + + if (KioskPreference.getInstance().getCartInfo().size() != 0) { + menu_cart_tv.setVisibility(View.VISIBLE); + } else { + menu_cart_tv.setVisibility(View.INVISIBLE); + } + } + } + + @Override + protected void onPause() { + super.onPause(); + } + +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/MenuAdapter.java b/app/src/main/java/net/bluehack/kiosk/menu/MenuAdapter.java new file mode 100644 index 0000000..921c7d3 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/MenuAdapter.java @@ -0,0 +1,102 @@ +package net.bluehack.kiosk.menu; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.content.Context; +import android.content.Intent; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.google.gson.Gson; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.menu.option.MenuOptionActivity; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.MenuResData; + +public class MenuAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(MenuAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public MenuAdapter(Context context) { + this.context = context; + } + + @Override + public MenuViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_item, parent, false); + return new MenuViewHolder(v); + } + + @Override + public void onBindViewHolder(MenuViewHolder holder, int position) { + + final MenuResData menuResDataItem = list.get(position); + final String url = UiUtil.getFileImgUrl(); + //final String url = "http://lorempixel.com/600/400/city/"; + + Glide.with(context) + .load(url + menuResDataItem.getFileId()) + .override(64, 64) + .centerCrop() + //.placeholder(R.drawable.img_storelogo_default) + //.skipMemoryCache(true) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_b_default) + .into(holder.menuImage); + holder.name.setText(menuResDataItem.getMItem()); + holder.price.setText("$ " + String.valueOf(menuResDataItem.getPrice())); + holder.calory.setText(String.valueOf(menuResDataItem.getCalory()) + "kcal"); + holder.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.TapMenuEvent(GaCategory.MENU, menuResDataItem.getMItem()); + Intent intent = new Intent(context, MenuOptionActivity.class); + Gson gson = new Gson(); + String menuInfo = gson.toJson(menuResDataItem); + intent.putExtra("menu_info", menuInfo); + + context.startActivity(intent); + } + }); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/MenuViewHolder.java b/app/src/main/java/net/bluehack/kiosk/menu/MenuViewHolder.java new file mode 100644 index 0000000..0d191f5 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/MenuViewHolder.java @@ -0,0 +1,32 @@ +package net.bluehack.kiosk.menu; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +import de.hdodenhof.circleimageview.CircleImageView; + +public class MenuViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + TextView name; + TextView price; + TextView calory; + CircleImageView menuImage; + ImageView imageBtn; + + public MenuViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.menu_card_view); + this.name = (TextView) itemView.findViewById(R.id.menu_cv_text_name); + this.price = (TextView) itemView.findViewById(R.id.menu_cv_text_price); + this.calory = (TextView) itemView.findViewById(R.id.menu_cv_text_calory); + this.menuImage = (CircleImageView) itemView.findViewById(R.id.menu_iv_img); + this.imageBtn = (ImageView) itemView.findViewById(R.id.menu_cv_iv_btn); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionActivity.java b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionActivity.java new file mode 100644 index 0000000..be974a5 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionActivity.java @@ -0,0 +1,474 @@ +package net.bluehack.kiosk.menu.option; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; +import com.google.gson.Gson; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.content.ContextCompat; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.payment.PaymentActivity; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderReqDetail; +import io.swagger.client.model.AddOrderReqOption; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.MenuOptionReq; +import io.swagger.client.model.MenuOptionRes; +import io.swagger.client.model.MenuOptionResOptions; +import io.swagger.client.model.MenuResData; + +public class MenuOptionActivity extends BaseActivity { + + private static final String TAG = makeLogTag(MenuOptionActivity.class); + private Context context; + private MenuOptionAdapter menuOptionAdapter; + private RecyclerView.LayoutManager menuOptionlayoutManager; + private RecyclerView menu_option_rv; + private ImageView menu_option_cart; + private CircleImageView menu_option_iv_img; + private ImageView menu_option_info_btn; + private ImageView menu_option_ib_count_minus; + private ImageView menu_option_ib_count_plus; + private ImageView menu_option_btn_cart; + private ImageView menu_option_btn_payment; + private TextView menu_option_tv_count; + private TextView menu_option_tv_title; + private TextView menu_option_tv_price; + private TextView menu_option_tv_info; + private TextView menu_option_tv_calory; + private TextView menu_cart_tv; + private LinearLayout menu_option_ll_info_title; + private LinearLayout menu_option_ll_info_content; + private static int menu_option_count_sum = 1; + private static boolean isVisibleMenuInfo = false; + private static List optionList = null; + private static List requiredOptionList = null; + private static CartMenuItem cartMenuItem = null; + + private String menu_id; + private String menu_name; + private Number menu_price; + private Number menu_point; + private String menu_image; + private String menu_description; + private Number menu_calory; + + private LinearLayout progress_ll; + private ImageView progress_iv; + private List orderList = null; + + public MenuOptionActivity() { + } + + public void staticInit(){ + + if (optionList != null) { + optionList.clear(); + optionList = null; + optionList = new ArrayList<>(); + } else { + optionList = new ArrayList<>(); + } + + if (requiredOptionList != null) { + requiredOptionList.clear(); + requiredOptionList = null; + requiredOptionList = new ArrayList<>(); + } else { + requiredOptionList = new ArrayList<>(); + } + + if (cartMenuItem != null) { + cartMenuItem = null; + cartMenuItem = new CartMenuItem(); + } else { + cartMenuItem = new CartMenuItem(); + } + } + + @Override + protected void onStart() { + super.onStart(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_menu_option); + + context = this; + + staticInit(); + menu_option_rv = (RecyclerView) findViewById(R.id.menu_option_rv); + menu_option_cart = (ImageView) findViewById(R.id.menu_option_cart); + menu_option_iv_img = (CircleImageView) findViewById(R.id.menu_option_iv_img); + menu_option_info_btn = (ImageView) findViewById(R.id.menu_option_info_btn); + menu_option_ib_count_minus = (ImageView) findViewById(R.id.menu_option_ib_count_minus); + menu_option_ib_count_plus = (ImageView) findViewById(R.id.menu_option_ib_count_plus); + menu_option_btn_cart = (ImageView) findViewById(R.id.menu_option_btn_cart); + menu_option_btn_payment = (ImageView) findViewById(R.id.menu_option_btn_payment); + menu_option_tv_count = (TextView) findViewById(R.id.menu_option_tv_count); + menu_option_tv_title = (TextView) findViewById(R.id.menu_option_tv_title); + menu_option_tv_price = (TextView) findViewById(R.id.menu_option_tv_price); + menu_option_tv_info = (TextView) findViewById(R.id.menu_option_tv_info); + menu_option_tv_calory = (TextView) findViewById(R.id.menu_option_tv_calory); + menu_cart_tv = (TextView) findViewById(R.id.menu_cart_tv); + menu_option_ll_info_title = (LinearLayout) findViewById(R.id.menu_option_ll_info_title); + menu_option_ll_info_content = (LinearLayout) findViewById(R.id.menu_option_ll_info_content); + + menuOptionlayoutManager = new LinearLayoutManager(this); + menuOptionAdapter = new MenuOptionAdapter(context); + menu_option_rv.setAdapter(menuOptionAdapter); + menu_option_rv.setLayoutManager(menuOptionlayoutManager); + + Intent intent = getIntent(); + String menu_info = intent.getExtras().getString("menu_info"); + final Gson gson = new Gson(); + MenuResData menuResDataItem = gson.fromJson(menu_info, MenuResData.class); + + menu_id = menuResDataItem.getMenuId(); + menu_name = menuResDataItem.getMItem(); + menu_price = menuResDataItem.getPrice(); + menu_point = menuResDataItem.getPoints(); + menu_image = menuResDataItem.getFileId(); + menu_description = menuResDataItem.getDescription(); + menu_calory = menuResDataItem.getCalory(); + + intent.removeExtra("menu_info"); + + MenuOptionReq menuOptionReq = new MenuOptionReq(); + menuOptionReq.setMenuId(menu_id); + + String store_id = ""; + if (KioskPreference.getInstance().getStoreInfo() != null) { + store_id = KioskPreference.getInstance().getStoreInfo().getStoreId(); + } + menuOptionReq.setStoreId(store_id); + + final String url = UiUtil.getFileImgUrl(); + Glide.with(context) + .load(url + menu_image) + .override(80, 80) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_c_default) + .into(menu_option_iv_img); + + menu_option_tv_title.setText(menu_name); + menu_option_tv_price.setText("$ " + String.valueOf(menu_price)); + menu_option_tv_calory.setText(String.valueOf(menu_calory) + " kcal"); + menu_option_tv_info.setText(menu_description); + menu_option_tv_count.setText(String.valueOf(menu_option_count_sum)); + + menu_option_ll_info_title.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (!isVisibleMenuInfo) { + menu_option_ll_info_content.setVisibility(View.VISIBLE); + menu_option_info_btn.setBackground(ContextCompat.getDrawable(context, R.drawable.btn_arrow_up_nor)); + isVisibleMenuInfo = true; + } else { + menu_option_ll_info_content.setVisibility(View.GONE); + menu_option_info_btn.setBackground(ContextCompat.getDrawable(context, R.drawable.btn_arrow_down_nor)); + isVisibleMenuInfo = false; + } + } + }); + LOGD(TAG, "menu_id : " + menu_id); + LOGD(TAG, "menu_name: " + menu_name); + LOGD(TAG, "menu_image: " + menu_image); + + + menu_option_ib_count_minus.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (menu_option_count_sum <= 1) { + menu_option_count_sum = 1; + menu_option_tv_count.setText(String.valueOf(menu_option_count_sum)); + } else { + menu_option_count_sum--; + menu_option_tv_count.setText(String.valueOf(menu_option_count_sum)); + } + } + }); + menu_option_ib_count_plus.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (menu_option_count_sum >= 99) { + menu_option_count_sum = 99; + menu_option_tv_count.setText(String.valueOf(menu_option_count_sum)); + } else { + menu_option_count_sum++; + menu_option_tv_count.setText(String.valueOf(menu_option_count_sum)); + } + } + }); + + getMenuOptionlist(context, menuOptionReq); + + //add cart + menu_option_btn_cart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + CartMenuItem cartMenuItem = makeMenuInfo(); + //set menu info preference + if (menu_option_count_sum == 1) { + KioskPreference.getInstance().setCartInfo(cartMenuItem); + } else { + for (int i = 0; i < menu_option_count_sum; i ++) { + KioskPreference.getInstance().setCartInfo(cartMenuItem); + } + } + Toast.makeText(context, context.getResources().getString(R.string.add_cart), Toast.LENGTH_SHORT).show(); + menu_cart_tv.setVisibility(View.VISIBLE); + + LogEventTracker.TapAddCartEvent(GaCategory.OPTION, cartMenuItem); + } + }); + + menu_option_cart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //start cartActivity + LogEventTracker.CartBtnEvent(GaCategory.OPTION); + Intent intent = new Intent(MenuOptionActivity.this, CartMenuActivity.class); + startActivity(intent); + } + }); + + menu_option_btn_payment.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + ArrayList selectMenuList = new ArrayList(); + CartMenuItem cartMenuItem = makeMenuInfo(); + LOGE(TAG, "cartmenuItem => " + UiUtil.toStringGson(cartMenuItem)); + + if (menu_option_count_sum == 1) { + selectMenuList.add(cartMenuItem); + + } else { + for (int i = 0; i < menu_option_count_sum; i ++) { + selectMenuList.add(cartMenuItem); + } + + } + + LogEventTracker.OrderBtnEvent(GaCategory.OPTION, selectMenuList); + Intent intent = new Intent(MenuOptionActivity.this, PaymentActivity.class); + intent.putExtra("selectMenuList", selectMenuList); + startActivity(intent); + } + }); + } + + private void getMenuOptionlist(final Context context, final MenuOptionReq menuOptionReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().menuDetailPost(context, menuOptionReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + MenuOptionRes menuOptionRes = (MenuOptionRes) result; + + Gson gson = new Gson(); + LOGE(TAG, "menuOptionRes result : " + gson.toJson(result)); + + if (menuOptionRes.getResponseStatus() != null && menuOptionRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + menuOptionAdapter.clean(); + + final ArrayList menuOptionList = new ArrayList(); //required option name list + + for (int i = 0; i < menuOptionRes.getData().size(); i++) { + for (int j = 0; j < menuOptionRes.getData().get(i).getOptions().size(); j++) { + + menuOptionList.add(menuOptionRes.getData().get(i).getOptions().get(j)); + } + } + + menuOptionAdapter.addItem(menuOptionList); + menuOptionAdapter.notifyDataSetChanged(); + + } else { + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.menu_option_not_found_menu), Toast.LENGTH_SHORT).show(); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + private CartMenuItem makeMenuInfo() { + + //make cartMenuItem + cartMenuItem = new CartMenuItem(); + cartMenuItem.setMenu_id(menu_id); + cartMenuItem.setMenu_name(menu_name); + cartMenuItem.setMenu_image(menu_image); + cartMenuItem.setMenu_price(String.valueOf(menu_price)); + cartMenuItem.setMenu_point(String.valueOf(menu_point)); + cartMenuItem.setMenu_calory(String.valueOf(menu_calory)); + cartMenuItem.setMenu_description(menu_description); + + //get checked menu option list + List isCheckedOptionList = new ArrayList<>(); + for (int i = 0; i < optionList.size(); i ++) { + if (optionList.get(i).isChecked()) { + isCheckedOptionList.add(optionList.get(i)); + } + } + cartMenuItem.setCartMenuOptionItems(isCheckedOptionList); + + //get checked menu required option list + List isCheckedRequiredOptionList = new ArrayList<>(); + if (isCheckedRequiredOptionList != null) { + isCheckedRequiredOptionList.clear(); + } + for (int i = 0; i < requiredOptionList.size(); i ++) { + if (requiredOptionList.get(i).isChecked()) { + isCheckedRequiredOptionList.add(requiredOptionList.get(i)); + } + } + cartMenuItem.setCartMenuRequireOptionItems(isCheckedRequiredOptionList); + + return cartMenuItem; + } + + public List getMenuOptionList() { + return optionList; + } + + public void setMenuOptionList(CartMenuOptionItem optionItems) { + if (optionItems.isChecked()) { + optionList.add(optionItems); + } else { + for (int i = 0; i < optionList.size(); i ++) { + if (optionList.get(i).getMenu_option_id().equals(optionItems.getMenu_option_id())) { + optionList.remove(i); + LOGE(TAG, "optionList =>" + UiUtil.toStringGson(optionList)); + } + } + + } + } + + public void clearMenuOptionListIndex() { + if (optionList != null) { + optionList.clear(); + } + } + + public List getMenuRequiredOptionMap() { + return requiredOptionList; + } + + public void setMenuRequiredOptionMap(CartMenuRequireOptionItem requiredItems) { + if (requiredItems.isChecked()) { + requiredOptionList.add(requiredItems); + } else { + for (int i = 0; i < requiredOptionList.size(); i ++) { + if (requiredOptionList.get(i).getMenu_rq_option_id().equals(requiredItems.getMenu_rq_option_id())) { + requiredOptionList.remove(i); + LOGE(TAG, "requiredOptionList =>" + UiUtil.toStringGson(requiredOptionList)); + } + } + } + } + + public void clearRequiredOptionMap() { + if (requiredOptionList != null) { + requiredOptionList.clear(); + } + } + + + @Override + protected void onResume() { + super.onResume(); + + if (KioskPreference.getInstance().getCartInfo() != null) { + + if (KioskPreference.getInstance().getCartInfo().size() != 0) { + menu_cart_tv.setVisibility(View.VISIBLE); + } else { + menu_cart_tv.setVisibility(View.INVISIBLE); + } + } + } + + @Override + protected void onPause() { + super.onPause(); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + + if (optionList != null) { + optionList.clear(); + } + + if (requiredOptionList != null) { + requiredOptionList.clear(); + } + + if (cartMenuItem != null) { + cartMenuItem = null; + } + + menu_option_count_sum = 1; + + menuOptionAdapter.clean(); + menuOptionAdapter.notifyDataSetChanged(); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionAdapter.java new file mode 100644 index 0000000..1dc4e6b --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionAdapter.java @@ -0,0 +1,129 @@ +package net.bluehack.kiosk.menu.option; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.content.Context; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.menu.option.detail.MenuChoiceDetailOptionAdapter; +import net.bluehack.kiosk.menu.option.detail.MenuRequiredDetailOptionAdapter; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.MenuOptionRes; +import io.swagger.client.model.MenuOptionResData; +import io.swagger.client.model.MenuOptionResData1; +import io.swagger.client.model.MenuOptionResOptions; + +public class MenuOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(MenuOptionAdapter.class); + + private Context context; + private static List list = new ArrayList<>(); + + public MenuOptionAdapter(Context context) { + this.context = context; + } + + @Override + public MenuOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_option_item, parent, false); + return new MenuOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(final MenuOptionViewHolder holder, final int position) { + + final MenuOptionResOptions menuOptionItems = list.get(position); + final ArrayList requiredOptions = new ArrayList(); + final ArrayList choiceOptions = new ArrayList(); + + final String menuRequiredOptionCategory = menuOptionItems.getCategoryName(); + + RecyclerView.LayoutManager detailOptionLayoutManager = new LinearLayoutManager(context); + MenuRequiredDetailOptionAdapter requiredAdapter = new MenuRequiredDetailOptionAdapter(context); + MenuChoiceDetailOptionAdapter choiceAdapter = new MenuChoiceDetailOptionAdapter(context); + + + /** + * option Type + * 1 = 단일 필수 (라디오 그룹중 오직 하나만) + * 2 = 단일 선택 (체크박스 그룹중 하나는 필수 선택) + * 3 = 다중 필수 (라디오 그룹중 적어도 하나는 필수) + * 4 = 다중 선택 (체크박스 그룹중 선택 옵션)*/ + + if (menuOptionItems.getOptionType().equals(1) || menuOptionItems.getOptionType().equals(2)) { + + for (int i = 0; i < menuOptionItems.getData().size(); i ++) { + requiredOptions.add(menuOptionItems.getData().get(i)); + } + } else if (menuOptionItems.getOptionType().equals(3) || menuOptionItems.getOptionType().equals(4)) { + + for (int i = 0; i < menuOptionItems.getData().size(); i ++) { + choiceOptions.add(menuOptionItems.getData().get(i)); + } + + } + + if (requiredOptions.size() != 0) { + holder.option_tv_title.setText(menuRequiredOptionCategory); + holder.option_tv_title.setVisibility(View.VISIBLE); + holder.option_rv.setLayoutManager(detailOptionLayoutManager); + holder.option_rv.setAdapter(requiredAdapter); + + requiredAdapter.clean(); + requiredAdapter.addItem(requiredOptions); + requiredAdapter.notifyDataSetChanged(); + } + + if (choiceOptions.size() != 0) { + holder.option_tv_title.setText(menuRequiredOptionCategory); + holder.option_tv_title.setVisibility(View.VISIBLE); + holder.option_rv.setLayoutManager(detailOptionLayoutManager); + holder.option_rv.setAdapter(choiceAdapter); + + choiceAdapter.clean(); + choiceAdapter.addItem(choiceOptions); + choiceAdapter.notifyDataSetChanged(); + } + + + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } + + public List getList() { + return list; + } + +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionViewHolder.java new file mode 100644 index 0000000..0be6f43 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/MenuOptionViewHolder.java @@ -0,0 +1,24 @@ +package net.bluehack.kiosk.menu.option; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.RadioButton; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class MenuOptionViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + TextView option_tv_title; + RecyclerView option_rv; + + public MenuOptionViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.cardView); + this.option_tv_title = (TextView) itemView.findViewById(R.id.option_tv_title); + this.option_rv = (RecyclerView) itemView.findViewById(R.id.option_rv); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionAdapter.java new file mode 100644 index 0000000..c923224 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionAdapter.java @@ -0,0 +1,116 @@ +package net.bluehack.kiosk.menu.option.detail; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.CompoundButton; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.menu.option.MenuOptionActivity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.swagger.client.model.MenuOptionResData; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class MenuChoiceDetailOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(MenuChoiceDetailOptionAdapter.class); + private Context context; + private MenuOptionActivity menuOptionActivity = new MenuOptionActivity(); + private List list = new ArrayList<>(); + + public MenuChoiceDetailOptionAdapter(Context context) { + this.context = context; + } + + @Override + public MenuChoiceDetailOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_option_choice_item, parent, false); + return new MenuChoiceDetailOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(final MenuChoiceDetailOptionViewHolder holder, final int position) { + + MenuOptionResData menuOptionDetailItem = list.get(position); + final String menuChoiceDetailOptionId = menuOptionDetailItem.getId(); + final String menuChoiceDetailOptionName = menuOptionDetailItem.getOption(); + final Number menuChoiceDetailOptionPrice = menuOptionDetailItem.getPrice(); + + final CartMenuOptionItem cartMenuOptionItem = new CartMenuOptionItem(); + cartMenuOptionItem.setMenu_option_id(menuChoiceDetailOptionId); + cartMenuOptionItem.setMenu_option_name(menuChoiceDetailOptionName); + cartMenuOptionItem.setMenu_option_price(String.valueOf(menuChoiceDetailOptionPrice)); + cartMenuOptionItem.setChecked(false); + + holder.option_choice_tv_title.setText(menuChoiceDetailOptionName); + holder.option_choice_tv_price.setText("$ " + String.valueOf(menuChoiceDetailOptionPrice)); + + holder.option_choice_cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + CheckBox cb = (CheckBox) buttonView; + if (cb.isChecked()) { + holder.option_choice_cb.setChecked(true); + cartMenuOptionItem.setChecked(true); + + menuOptionActivity.setMenuOptionList(cartMenuOptionItem); + notifyDataSetChanged(); + } else { + holder.option_choice_cb.setChecked(false); + cartMenuOptionItem.setChecked(false); + + menuOptionActivity.setMenuOptionList(cartMenuOptionItem); + notifyDataSetChanged(); + } + + } + }); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } + + /*public List getMenuOptionList() { + return optionList; + } + + public void setMenuOptionList(CartMenuOptionItem optionItems) { + if (optionItems.isChecked()) { + optionList.add(optionItems); + } else { + optionList.remove(optionItems); + } + }*/ + +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionViewHolder.java new file mode 100644 index 0000000..d7101f2 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuChoiceDetailOptionViewHolder.java @@ -0,0 +1,27 @@ +package net.bluehack.kiosk.menu.option.detail; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.CheckBox; +import android.widget.RadioButton; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class MenuChoiceDetailOptionViewHolder extends RecyclerView.ViewHolder { + + CardView option_choice_card_view; + CheckBox option_choice_cb; + TextView option_choice_tv_title; + TextView option_choice_tv_price; + + public MenuChoiceDetailOptionViewHolder(View itemView) { + super(itemView); + + this.option_choice_card_view = (CardView) itemView.findViewById(R.id.option_choice_card_view); + this.option_choice_cb = (CheckBox) itemView.findViewById(R.id.option_choice_cb); + this.option_choice_tv_title = (TextView) itemView.findViewById(R.id.option_choice_tv_title); + this.option_choice_tv_price = (TextView) itemView.findViewById(R.id.option_choice_tv_price); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionAdapter.java new file mode 100644 index 0000000..d8ac802 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionAdapter.java @@ -0,0 +1,121 @@ +package net.bluehack.kiosk.menu.option.detail; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CompoundButton; +import android.widget.RadioButton; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; +import net.bluehack.kiosk.menu.option.MenuOptionActivity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.swagger.client.model.MenuOptionResData; +import io.swagger.client.model.MenuOptionResData1; +import io.swagger.client.model.MenuOptionResOptions; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class MenuRequiredDetailOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(MenuRequiredDetailOptionAdapter.class); + private Context context; + private MenuOptionActivity menuOptionActivity = new MenuOptionActivity(); + private List list = new ArrayList<>(); + //private static HashMap requiredMap = new HashMap(); + + private RadioButton lastChecked = null; + + public MenuRequiredDetailOptionAdapter(Context context) { + this.context = context; + } + + @Override + public MenuRequiredDetailOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_option_required_item, parent, false); + return new MenuRequiredDetailOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(final MenuRequiredDetailOptionViewHolder holder, final int position) { + + MenuOptionResData menuOptionRequiredItem = list.get(position); + + final String detailOptionId = menuOptionRequiredItem.getId(); + final String detailOptionName = menuOptionRequiredItem.getOption(); + final Number detailOptionPrice = menuOptionRequiredItem.getPrice(); + final CartMenuRequireOptionItem cartMenuRequireOptionItem = new CartMenuRequireOptionItem(); + + cartMenuRequireOptionItem.setMenu_rq_option_id(detailOptionId); + cartMenuRequireOptionItem.setMenu_rq_option_name(detailOptionName); + cartMenuRequireOptionItem.setMenu_rq_option_price(String.valueOf(detailOptionPrice)); + cartMenuRequireOptionItem.setChecked(false); + cartMenuRequireOptionItem.setRequiredChecked(false); + + + holder.option_required_tv_title.setText(detailOptionName); + holder.option_required_tv_price.setText("$ " + String.valueOf(detailOptionPrice)); + + LOGE(TAG, "menuRequiredDetailOptionName:" + detailOptionPrice); + + if (position == 0) { + lastChecked = holder.option_required_rb; + lastChecked.setChecked(true); + cartMenuRequireOptionItem.setChecked(true); + menuOptionActivity.setMenuRequiredOptionMap(cartMenuRequireOptionItem); + } + + holder.option_required_rb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton v, boolean isChecked) { + RadioButton rb = (RadioButton) v; + + if (rb.isChecked()) { + if (lastChecked.isChecked()) { + lastChecked.setChecked(false); + } + + lastChecked = rb; + lastChecked.setChecked(true); + cartMenuRequireOptionItem.setChecked(true); + menuOptionActivity.setMenuRequiredOptionMap(cartMenuRequireOptionItem); + + } else { + lastChecked.setChecked(false); + cartMenuRequireOptionItem.setChecked(false); + menuOptionActivity.setMenuRequiredOptionMap(cartMenuRequireOptionItem); + } + } + }); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + + public void clean() { + list.clear(); + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionViewHolder.java new file mode 100644 index 0000000..dc79cfb --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/menu/option/detail/MenuRequiredDetailOptionViewHolder.java @@ -0,0 +1,26 @@ +package net.bluehack.kiosk.menu.option.detail; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.RadioButton; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class MenuRequiredDetailOptionViewHolder extends RecyclerView.ViewHolder { + + CardView option_required_cardView; + RadioButton option_required_rb; + TextView option_required_tv_title; + TextView option_required_tv_price; + + public MenuRequiredDetailOptionViewHolder(View itemView) { + super(itemView); + + this.option_required_cardView = (CardView) itemView.findViewById(R.id.option_required_cardView); + this.option_required_rb = (RadioButton) itemView.findViewById(R.id.option_required_rb); + this.option_required_tv_title = (TextView) itemView.findViewById(R.id.option_required_tv_title); + this.option_required_tv_price = (TextView) itemView.findViewById(R.id.option_required_tv_price); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/myinfo/MyInfoActivity.java b/app/src/main/java/net/bluehack/kiosk/myinfo/MyInfoActivity.java new file mode 100644 index 0000000..a9f8c95 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/myinfo/MyInfoActivity.java @@ -0,0 +1,118 @@ +package net.bluehack.kiosk.myinfo; + +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.google.gson.Gson; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.login.LoginActivity; +import net.bluehack.kiosk.util.KioskPreference; + +public class MyInfoActivity extends BaseActivity { + + private static final String TAG = makeLogTag(MyInfoActivity.class); + private Context context; + private TextView myinfo_text_id; + private TextView myinfo_text_name; + private TextView myinfo_text_phone; + private TextView myinfo_text_point; + private ImageView myinfo_iv_btn; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_myinfo); + + context = getApplicationContext(); + + myinfo_text_id = (TextView) findViewById(R.id.myinfo_text_id); + myinfo_text_name = (TextView) findViewById(R.id.myinfo_text_name); + myinfo_text_phone = (TextView) findViewById(R.id.myinfo_text_phone); + myinfo_text_point = (TextView) findViewById(R.id.myinfo_text_point); + myinfo_iv_btn = (ImageView) findViewById(R.id.myinfo_iv_btn); + + if (KioskPreference.getInstance().getStoreInfo() != null && KioskPreference.getInstance().getLoginInfo() != null) { + String storeName = KioskPreference.getInstance().getStoreInfo().getStore(); + String accountId = KioskPreference.getInstance().getLoginInfo().getAccountId(); + String userName; + String userPhone; + int userPoint = 0; + + if (KioskPreference.getInstance().getStoreInfo().getUPoints() != null) { + userPoint = KioskPreference.getInstance().getStoreInfo().getUPoints(); + } else { + userPoint = 0; + } + + if (KioskPreference.getInstance().getLoginInfo().getName() != null) { + userName = KioskPreference.getInstance().getLoginInfo().getName(); + } else { + userName = ""; + } + + if (KioskPreference.getInstance().getLoginInfo().getPhone() != null) { + userPhone = KioskPreference.getInstance().getLoginInfo().getPhone(); + } else { + userPhone = ""; + } + + myinfo_text_id.setText(accountId); + myinfo_text_name.setText(userName); + myinfo_text_phone.setText(userPhone); + myinfo_text_point.setText(String.valueOf(userPoint) + "(" + storeName + ")"); + } + + //log out + myinfo_iv_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.LogoutBtnEvent(GaCategory.MYINFO); + //init My Info + KioskPreference.getInstance().clearLoginInfo(); + KioskPreference.getInstance().clearStoreInfo(); + KioskPreference.getInstance().clearCartInfo(); + + Intent intent = new Intent(context, LoginActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + } + }); + + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) + { + if ((keyCode == KeyEvent.KEYCODE_BACK)) + { + finish(); + } + return super.onKeyDown(keyCode, event); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebasePushReceiver.java b/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebasePushReceiver.java index 794c91a..b59193d 100644 --- a/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebasePushReceiver.java +++ b/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebasePushReceiver.java @@ -1,27 +1,199 @@ package net.bluehack.kiosk.notification.firebase; +import android.app.Activity; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.graphics.BitmapFactory; +import android.os.PowerManager; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.NotificationCompat; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.home.HomeActivity; +import net.bluehack.kiosk.home.model.Ticket; +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.popup.CompletedStatusPopup; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.PushWakeLock; +import net.bluehack.kiosk.util.UiUtil; + import java.util.Map; -import static net.bluehack.kiosk.util.Logger.LOGD; -import static net.bluehack.kiosk.util.Logger.makeLogTag; +import io.swagger.client.ApiClient; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; public class FirebasePushReceiver extends FirebaseMessagingService { private static final String TAG = makeLogTag(FirebasePushReceiver.class); + private Context context; + private String order_id = ""; public FirebasePushReceiver() { } @Override public void onMessageReceived(RemoteMessage remoteMessage) { - //super.onMessageReceived(remoteMessage); - Map message = remoteMessage.getData(); - for( String key : message.keySet() ){ - LOGD( TAG, String.format("키 : %s, 값 : %s", key, message) ); + context = ApplicationLoader.getContext(); + + Map message = remoteMessage.getData(); + for (String key : message.keySet()) { + + LOGD(TAG, String.format("키 : %s, 값 : %s", key, message)); + } + LOGD(TAG, "COOK_STATUS:" + message.get("type")); + + notificationStatusBar(message); + } + + private void notificationStatusBar(Map message) { + + int cook_status = 0; + String order_num = ""; + String contentTitle = ""; + String contentText = ""; + + if (message.get("type") != null) { + cook_status = Integer.valueOf(message.get("type")); + } + if (message.get("order_num") != null) { + order_num = message.get("order_num"); + } + + if (message.get("order_id") != null) { + order_id = message.get("order_id"); } + + switch (cook_status) { + + case Ticket.RECEIVE: + + contentTitle = String.valueOf(Ticket.State.Prepare); + contentText = getResources().getString(R.string.push_prepare_01) + "(" + order_num + ")" + + getResources().getString(R.string.push_prepare_02); + + getOrderHistory(context, createOrderReq(), contentTitle, contentText); + break; + + case Ticket.MAKING: + + contentTitle = String.valueOf(Ticket.State.InCook); + contentText = getResources().getString(R.string.push_in_cook) + "(" + order_num + ")"; + + getOrderHistory(context, createOrderReq(), contentTitle, contentText); + break; + + case Ticket.COMPLETE: + + contentTitle = String.valueOf(Ticket.State.Ready); + contentText = getResources().getString(R.string.push_ready_01) + "(" + order_num + ")" + + getResources().getString(R.string.push_ready_02); + + getOrderHistory(context, createOrderReq(), contentTitle, contentText); + completedStatusPopup(order_num); + break; + + default: + break; + } + } + + private OrderReq createOrderReq() { + + String store_id = ""; + String user_id = ""; + + if (KioskPreference.getInstance().getStoreInfo() != null) { + store_id = KioskPreference.getInstance().getStoreInfo().getStoreId(); + user_id = KioskPreference.getInstance().getStoreInfo().getUserId(); + } + + OrderReq orderReq = new OrderReq(); + orderReq.setStoreId(store_id); + orderReq.setUserId(user_id); + orderReq.setOrderId(order_id); + + return orderReq; + } + + private void getOrderHistory(final Context context, final OrderReq orderReq, final String contentTitle, final String contentText) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().orderPaymentListPost(context, orderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + OrderRes orderRes = (OrderRes) result; + + if (orderRes.getResponseStatus() != null && orderRes.getResponseStatus().equals(200)) { + + String orderInfo = UiUtil.toStringGson(orderRes.getData().get(0)); + + Intent ticketIntent = new Intent(context, TicketActivity.class); + ticketIntent.putExtra("clicked_order", orderInfo); + + makeNotification(ticketIntent, contentTitle, contentText); + + } else { + LOGE(TAG, "getOrderHistory error !"); + } + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + + private void makeNotification (Intent ticketIntent, final String contentTitle, final String contentText) { + + NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, ticketIntent, PendingIntent.FLAG_UPDATE_CURRENT); + + NotificationCompat.Builder compatBuilder = new NotificationCompat.Builder(this); + compatBuilder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.app_icon)); + compatBuilder.setSmallIcon(R.drawable.img_notice_loogo_mini); + compatBuilder.setTicker(contentText); + compatBuilder.setWhen(System.currentTimeMillis()); + compatBuilder.setContentTitle(contentTitle); + compatBuilder.setContentText(contentText); + compatBuilder.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE); + compatBuilder.setContentIntent(pendingIntent); + compatBuilder.setAutoCancel(true); + + nm.notify(1, compatBuilder.build()); + } + + private void completedStatusPopup(String order_num) { + + Intent intent = new Intent(context, CompletedStatusPopup.class); + intent.putExtra("order_num", order_num); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); } } diff --git a/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebaseTokenService.java b/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebaseTokenService.java new file mode 100644 index 0000000..bb876df --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/notification/firebase/FirebaseTokenService.java @@ -0,0 +1,21 @@ +package net.bluehack.kiosk.notification.firebase; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.iid.FirebaseInstanceIdService; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class FirebaseTokenService extends FirebaseInstanceIdService { + + private static final String TAG = makeLogTag(FirebaseTokenService.class); + + @Override + public void onTokenRefresh() { + + String push_token = FirebaseInstanceId.getInstance().getToken(); + LOGD(TAG, "init push_token : " + push_token); + + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/order/CatalogAdapter.java b/app/src/main/java/net/bluehack/kiosk/order/CatalogAdapter.java deleted file mode 100644 index 4a5babe..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order/CatalogAdapter.java +++ /dev/null @@ -1,104 +0,0 @@ -package net.bluehack.kiosk.order; - -import android.app.Activity; -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import net.bluehack.kiosk.R; -import net.bluehack.kiosk.api.ApiClient; -import net.bluehack.kiosk.model.Menu; -import net.bluehack.kiosk.model.MenuDataItem; - -import java.util.ArrayList; - -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class CatalogAdapter extends RecyclerView.Adapter { - - private static final String TAG = makeLogTag(CatalogAdapter.class); - private Context context; - private static final String methodQuery = "bmod"; - private static ArrayList list = new ArrayList(); - private MenuItemAdapter menuItemAdapter; - - public CatalogAdapter(Context context, MenuItemAdapter menuItemAdapter) { - this.context = context; - this.menuItemAdapter = menuItemAdapter; - - list.add(context.getResources().getString(R.string.txt_order_catalog_name_01)); - list.add(context.getResources().getString(R.string.txt_order_catalog_name_02)); - list.add(context.getResources().getString(R.string.txt_order_catalog_name_03)); - list.add(context.getResources().getString(R.string.txt_order_catalog_name_04)); - } - - @Override - public CatalogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.order_catalog_item, parent, false); - return new CatalogViewHolder(v); - } - - @Override - public void onBindViewHolder(CatalogViewHolder holder, int position) { - - String item = list.get(position); - holder.name.setText(item); - - holder.itemView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - - //Call catalog menu items - ApiClient.getInstance().menuGet(methodQuery, new ApiClient.ApiResponseListener() { - @Override - public void onResponse(final Object result) { - - new Thread(new Runnable() { - @Override - public void run() { - ((Activity) context).runOnUiThread(new Runnable() { - @Override - public void run() { - Menu menu = (Menu) result; - - if (menu.getSuccess()) { - - menuItemAdapter.clean(); - - ArrayList menuItems = new ArrayList<>(); - - for (MenuDataItem item : menu.getData()) { - - MenuDataItem menuDataItem = new MenuDataItem(); - menuDataItem.setName(item.getName()); - menuDataItem.setPrice(item.getPrice()); - - menuItems.add(menuDataItem); - } - menuItemAdapter.addItem(menuItems); - menuItemAdapter.notifyDataSetChanged(); - } - } - }); - } - }).start(); - - } - }); - - } - }); - - } - - @Override - public int getItemCount() { - if (list != null) { - return list.size(); - } else { - return 0; - } - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/order/CatalogViewHolder.java b/app/src/main/java/net/bluehack/kiosk/order/CatalogViewHolder.java deleted file mode 100644 index 079c707..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order/CatalogViewHolder.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.bluehack.kiosk.order; - -import android.support.v7.widget.CardView; -import android.support.v7.widget.RecyclerView; -import android.view.View; -import android.widget.TextView; - -import net.bluehack.kiosk.R; - -public class CatalogViewHolder extends RecyclerView.ViewHolder { - - CardView cardView; - TextView name; - - public CatalogViewHolder(View itemView) { - super(itemView); - - this.cardView = (CardView) itemView.findViewById(R.id.catalog_list); - this.name = (TextView) itemView.findViewById(R.id.txt_order_catalog_name); - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/order/MenuItemAdapter.java b/app/src/main/java/net/bluehack/kiosk/order/MenuItemAdapter.java deleted file mode 100644 index 76ac450..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order/MenuItemAdapter.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.bluehack.kiosk.order; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import net.bluehack.kiosk.R; -import net.bluehack.kiosk.model.MenuDataItem; - -import java.util.ArrayList; - -import static net.bluehack.kiosk.util.Logger.LOGE; -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class MenuItemAdapter extends RecyclerView.Adapter { - - private static final String TAG = makeLogTag(MenuItemAdapter.class); - private Context context; - private ArrayList list = new ArrayList(); - - - public MenuItemAdapter() { - } - - @Override - public MenuItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.order_menu_item, parent, false); - return new MenuItemViewHolder(v); - } - - @Override - public void onBindViewHolder(MenuItemViewHolder holder, int position) { - MenuDataItem item = list.get(position); - - holder.name.setText(item.getName()); - holder.price.setText(item.getPrice()); - } - - @Override - public int getItemCount() { - if (list != null) { - return list.size(); - }else { - return 0; - } - } - - public void clean() { - if (list != null && list.size() != 0) { - list.clear(); - } - } - - public void addItem(ArrayList menuList) { - if (menuList instanceof ArrayList) { - list = menuList; - }else { - LOGE(TAG, "addItem error!"); - } - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/order/MenuItemViewHolder.java b/app/src/main/java/net/bluehack/kiosk/order/MenuItemViewHolder.java deleted file mode 100644 index b6c1158..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order/MenuItemViewHolder.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.bluehack.kiosk.order; - -import android.support.v7.widget.CardView; -import android.support.v7.widget.RecyclerView; -import android.view.View; -import android.widget.TextView; - -import net.bluehack.kiosk.R; - -public class MenuItemViewHolder extends RecyclerView.ViewHolder { - - CardView cardView; - TextView name; - TextView price; - - public MenuItemViewHolder(View itemView) { - super(itemView); - - this.cardView = (CardView) itemView.findViewById(R.id.order_menu_card_view); - this.name = (TextView) itemView.findViewById(R.id.txt_order_menu_name); - this.price = (TextView) itemView.findViewById(R.id.txt_order_menu_price); - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/order/OrderActivity.java b/app/src/main/java/net/bluehack/kiosk/order/OrderActivity.java deleted file mode 100644 index 650897f..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order/OrderActivity.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.bluehack.kiosk.order; - -import android.content.Context; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; - -import net.bluehack.kiosk.R; -import net.bluehack.kiosk.main.RecentCardAdapter; - -public class OrderActivity extends AppCompatActivity { - - private RecyclerView catalogRecyclerView; - private RecyclerView menuItemRecyclerView; - private RecyclerView.LayoutManager catalogLayoutManager; - private RecyclerView.LayoutManager menuItemLayoutManager; - private CatalogAdapter catalogAdapter; - private MenuItemAdapter menuItemAdapter; - private Context context; - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order); - - context = this; - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - ActionBar actionBar = getSupportActionBar(); - actionBar.setHomeAsUpIndicator(R.drawable.btn_main_menu_nor); - actionBar.setDisplayHomeAsUpEnabled(true); - - catalogRecyclerView = (RecyclerView) findViewById(R.id.catalog_list); - menuItemRecyclerView = (RecyclerView) findViewById(R.id.order_menu_list); - - catalogLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL,false); - menuItemLayoutManager = new LinearLayoutManager(this); - menuItemAdapter = new MenuItemAdapter(); - catalogAdapter = new CatalogAdapter(context, menuItemAdapter); - - catalogRecyclerView.setHasFixedSize(true); - catalogRecyclerView.setLayoutManager(catalogLayoutManager); - catalogRecyclerView.setAdapter(catalogAdapter); - - menuItemRecyclerView.setHasFixedSize(true); - menuItemRecyclerView.setLayoutManager(menuItemLayoutManager); - menuItemRecyclerView.setAdapter(menuItemAdapter); - - } - -} diff --git a/app/src/main/java/net/bluehack/kiosk/order_option/OrderOptionActivity.java b/app/src/main/java/net/bluehack/kiosk/order_option/OrderOptionActivity.java deleted file mode 100644 index f5d44b1..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order_option/OrderOptionActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.bluehack.kiosk.order_option; - -import android.content.Intent; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.ImageView; - -import net.bluehack.kiosk.process.ProcessActivity; -import net.bluehack.kiosk.R; - -public class OrderOptionActivity extends AppCompatActivity { - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order_option); - - ImageView iv = (ImageView) findViewById(R.id.btn_option_order_now); - - iv.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(OrderOptionActivity.this, ProcessActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } - }); - - } - - -} diff --git a/app/src/main/java/net/bluehack/kiosk/order_pay/OrderPayActivity.java b/app/src/main/java/net/bluehack/kiosk/order_pay/OrderPayActivity.java deleted file mode 100644 index 05d0963..0000000 --- a/app/src/main/java/net/bluehack/kiosk/order_pay/OrderPayActivity.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.bluehack.kiosk.order_pay; - -import android.content.Intent; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.ImageView; - -import net.bluehack.kiosk.R; -import net.bluehack.kiosk.order_option.OrderOptionActivity; - -public class OrderPayActivity extends AppCompatActivity { - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order_pay); - - ImageView iv = (ImageView) findViewById(R.id.btn_pay_order_submit); - - iv.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(OrderPayActivity.this, OrderOptionActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } - }); - - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentActivity.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentActivity.java new file mode 100644 index 0000000..6a1060a --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentActivity.java @@ -0,0 +1,878 @@ +package net.bluehack.kiosk.payment; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.content.res.Configuration; +import android.graphics.Color; +import android.os.Bundle; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.text.Editable; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.TextWatcher; +import android.text.style.ForegroundColorSpan; +import android.view.View; +import android.view.inputmethod.InputMethodManager; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RadioButton; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.subcategory.SubCategoryActivity; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import de.hdodenhof.circleimageview.CircleImageView; +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.AddOrderReqDetail; +import io.swagger.client.model.AddOrderReqOption; +import io.swagger.client.model.AddOrderRes; +import io.swagger.client.model.AddOrderResData; +import io.swagger.client.model.AddOrderResDataSoldOut; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; +import io.swagger.client.model.OrderResData; +import io.swagger.client.model.StoresResData; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PaymentActivity extends BaseActivity { + + private static final String TAG = makeLogTag(PaymentActivity.class); + private Context context; + private RecyclerView payment_menu_rv_list; + private ImageView payment_btn_payment; + private CircleImageView payment_store_iv_img; + private TextView payment_store_tv_name; + private TextView payment_store_tv_address; + private EditText payment_usepoint_et; + private TextView payment_details_tv_subtotal_price; + private TextView payment_details_tv_usepoint_price; + private TextView payment_details_tv_tax_price; + private TextView payment_detatils_tv_total_count; + private TextView payment_details_tv_total_price; + private RadioButton payment_rb_card; + private CheckBox payment_cb_usepoint; + private LinearLayout payment_ll_point; + private LinearLayoutManager layoutManager; + private PaymentAdapter paymentAdapter; + private LinearLayout progress_ll; + private ImageView progress_iv; + private RelativeLayout payment_rl; + private String usepointText = "0"; + private ArrayList selectMenuList = new ArrayList(); + private TextView payment_usepoint_underline; + private InputMethodManager inputMethodManager; + + //TODO: fixme => 계산 정보 + private int orderCountSum = 0; + private double pointSum = 0.00; + private double priceSum = 0.00; + private double optionPriceSum = 0.00; + private double tax = 0.00; + private double sub_total = 0.00; + private double total = 0.00; + //TODO: fixme => point값 설정. + private int storePoint = 0; + private List orderList = null; + private String userId = ""; + private String storeId = ""; + private String order_id = ""; + private int checkedIntentFlag = 0; // 1 = optionActivity, 2 = cartActivity, 3 = historyDetailActivity + + @Override + protected void onStart() { + super.onStart(); + } + + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_payment); + + context = this; + + payment_menu_rv_list = (RecyclerView) findViewById(R.id.payment_menu_rv_list); + payment_btn_payment = (ImageView) findViewById(R.id.payment_btn_payment); + payment_store_iv_img = (CircleImageView) findViewById(R.id.payment_store_iv_img); + payment_store_tv_name = (TextView) findViewById(R.id.payment_store_tv_name); + payment_store_tv_address = (TextView) findViewById(R.id.payment_store_tv_address); + payment_usepoint_et = (EditText) findViewById(R.id.payment_usepoint_et); + payment_details_tv_subtotal_price = (TextView) findViewById(R.id.payment_details_tv_subtotal_price); + payment_details_tv_usepoint_price = (TextView) findViewById(R.id.payment_details_tv_usepoint_price); + payment_details_tv_tax_price = (TextView) findViewById(R.id.payment_details_tv_tax_price); + payment_detatils_tv_total_count = (TextView) findViewById(R.id.payment_detatils_tv_total_count); + payment_details_tv_total_price = (TextView) findViewById(R.id.payment_details_tv_total_price); + payment_rb_card = (RadioButton) findViewById(R.id.payment_rb_card); + payment_cb_usepoint = (CheckBox) findViewById(R.id.payment_cb_usepoint); + payment_ll_point = (LinearLayout) findViewById(R.id.payment_ll_point); + payment_usepoint_underline = (TextView) findViewById(R.id.payment_usepoint_underline); + inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + + payment_usepoint_et.setTextColor(Color.BLACK); + //TODO: fixme => menu info (cart list or order list) + Intent intent = getIntent(); + if (intent.getSerializableExtra("selectMenuList") != null) { + if (selectMenuList != null) { + selectMenuList.clear(); + } + selectMenuList = (ArrayList) intent.getSerializableExtra("selectMenuList"); + intent.removeExtra("selectMenuList"); + + checkedIntentFlag = 1; + } + + if (intent.getSerializableExtra("cartMenuList") != null) { + if (selectMenuList != null) { + selectMenuList.clear(); + } + selectMenuList = (ArrayList) intent.getSerializableExtra("cartMenuList"); + intent.removeExtra("cartMenuList"); + + checkedIntentFlag = 2; + } + + if (intent.getSerializableExtra("reorderMenuList") != null) { + if (selectMenuList != null) { + selectMenuList.clear(); + } + selectMenuList = (ArrayList) intent.getSerializableExtra("reorderMenuList"); + intent.removeExtra("reorderMenuList"); + + checkedIntentFlag = 3; + } + + layoutManager = new LinearLayoutManager(this); + paymentAdapter = new PaymentAdapter(context); + + payment_menu_rv_list.setHasFixedSize(true); + //payment_menu_rv_list.setNestedScrollingEnabled(false); + payment_menu_rv_list.setLayoutManager(layoutManager); + payment_menu_rv_list.setAdapter(paymentAdapter); + + paymentAdapter.clean(); + paymentAdapter.addItem(selectMenuList); + paymentAdapter.notifyDataSetChanged(); + + final StoresResData storeInfo = KioskPreference.getInstance().getStoreInfo(); + userId = storeInfo.getUserId(); + storeId = storeInfo.getStoreId(); + String storeLogo = storeInfo.getSLogo(); + final String storeName = storeInfo.getStore(); + String storeAddr = storeInfo.getSAddress(); + + //TODO: TESTCODE + //storePoint = 10; + if (storeInfo.getUPoints() != null) { + storePoint = storeInfo.getUPoints(); + } + + Glide.with(context) + .load(storeLogo) + .override(80, 80) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_storelogo_default) + .into(payment_store_iv_img); + payment_store_tv_name.setText(storeName); + payment_store_tv_address.setText(storeAddr); + + + orderList = new ArrayList<>(); + AddOrderReqOption orderChoiceOptionItem = null; + AddOrderReqOption orderRequiredOptionItem = null; + + for (int i = 0; i < selectMenuList.size(); i ++) { + AddOrderReqDetail orderItem = new AddOrderReqDetail(); + List orderOptionList = new ArrayList<>(); + String menuId = selectMenuList.get(i).getMenu_id(); + orderItem.setMenuId(menuId); + orderItem.setQuantity("1"); + + if (selectMenuList.get(i).getMenu_point() == null) { + pointSum = 0.00; + } else { + pointSum = pointSum + Double.valueOf(selectMenuList.get(i).getMenu_point()); + } + if (selectMenuList.get(i).getMenu_price() == null) { + priceSum = 0.00; + } else { + priceSum = priceSum + Double.valueOf(selectMenuList.get(i).getMenu_price()); + } + orderCountSum = i; + + if (selectMenuList.get(i).getCartMenuOptionItems() != null) { + for (int c = 0; c < selectMenuList.get(i).getCartMenuOptionItems().size(); c++) { + String choiceOptionId = selectMenuList.get(i).getCartMenuOptionItems().get(c).getMenu_option_id(); + + orderChoiceOptionItem = new AddOrderReqOption(); + orderChoiceOptionItem.setMenuId(choiceOptionId); + orderChoiceOptionItem.setQuantity("1"); + orderOptionList.add(orderChoiceOptionItem); + + if (selectMenuList.get(i).getCartMenuOptionItems().get(c).getMenu_option_price() == null) { + optionPriceSum = 0.00; + } else { + optionPriceSum = optionPriceSum + Double.valueOf(selectMenuList.get(i).getCartMenuOptionItems().get(c).getMenu_option_price()); + } + } + + + } + + if (selectMenuList.get(i).getCartMenuRequireOptionItems() != null) { + for (int r = 0; r < selectMenuList.get(i).getCartMenuRequireOptionItems().size(); r++) { + String requiredOptionId = selectMenuList.get(i).getCartMenuRequireOptionItems().get(r).getMenu_rq_option_id(); + + orderRequiredOptionItem = new AddOrderReqOption(); + orderRequiredOptionItem.setMenuId(requiredOptionId); + orderRequiredOptionItem.setQuantity("1"); + orderOptionList.add(orderRequiredOptionItem); + + if (selectMenuList.get(i).getCartMenuRequireOptionItems().get(r).getMenu_rq_option_price() == null) { + optionPriceSum = 0.00; + } else { + optionPriceSum = optionPriceSum + Double.valueOf(selectMenuList.get(i).getCartMenuRequireOptionItems().get(r).getMenu_rq_option_price()); + } + } + + } + + orderItem.setOption(orderOptionList); + orderList.add(i, orderItem); + } + LOGE(TAG, "orderList => " + UiUtil.toStringGson(orderList)); + + //tax + if (storeInfo.getSTax() != null) { + Double rate = Double.valueOf(String.valueOf(storeInfo.getSTax())); + tax = (priceSum + optionPriceSum) * rate; + tax = (int)(tax * 100) / 100.0; + } + + //sub total + sub_total = priceSum + optionPriceSum; + sub_total = (int) (sub_total * 100) / 100.0; + + //total + total = sub_total + tax; + total = (int) (total * 100) / 100.0; + + orderCountSum = orderCountSum + 1; + LOGD(TAG, "pointSum :" + pointSum); + LOGD(TAG, "orderCountSum :" + orderCountSum); + LOGD(TAG, "priceSum :" + priceSum); + LOGD(TAG, "optionPriceSum :" + optionPriceSum); + LOGD(TAG, "TAX :" + tax); + + payment_details_tv_subtotal_price.setText("$ " + String.valueOf(sub_total)); + payment_details_tv_usepoint_price.setText("0" + "P"); + payment_details_tv_tax_price.setText("$ " + String.valueOf(tax)); + //payment_detatils_tv_total_count.setText("Count : "+String.valueOf(orderCountSum)); + payment_detatils_tv_total_count.setText("Total"); + payment_details_tv_total_price.setText("$ " + String.valueOf(total)); + + payment_usepoint_et.setHint(String.valueOf(storePoint)); + payment_usepoint_et.setRawInputType(Configuration.KEYBOARD_QWERTY); + payment_cb_usepoint.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + + if (isChecked) { + LogEventTracker.OnUsePointsBtnEvent(GaCategory.PAYMENT); + payment_usepoint_et.requestFocus(); + inputMethodManager.showSoftInput(payment_usepoint_et, InputMethodManager.SHOW_IMPLICIT); + payment_ll_point.setVisibility(View.VISIBLE); + payment_usepoint_underline.setBackgroundColor(UiUtil.getColor(context, R.color.color_37)); + payment_usepoint_et.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + usepointText = s.toString(); + + if (usepointText.equals("") || usepointText == null) { + usepointText = "0"; + } + + payment_details_tv_usepoint_price.setText(String.valueOf(usepointText) + "P"); + + if (Integer.parseInt(usepointText) > storePoint) { + Toast.makeText(context, context.getResources().getString(R.string.payment_point_over),Toast.LENGTH_SHORT).show(); + s.clear(); + usepointText = String.valueOf(storePoint); + payment_details_tv_usepoint_price.setText(usepointText + "P"); + if (sub_total - Integer.parseInt(usepointText) < 0) { + payment_details_tv_total_price.setText("$ " + "0"); + } else { + payment_details_tv_total_price.setText("$ " + String.valueOf(total - Integer.parseInt(usepointText))); + } + } else { + + if (sub_total - Integer.parseInt(usepointText) < 0) { + payment_details_tv_total_price.setText("$ " + "0"); + } else { + payment_details_tv_total_price.setText("$ " + String.valueOf(total - Integer.parseInt(usepointText))); + } + } + + } + }); + } else { + LogEventTracker.OffUsePointsBtnEvent(GaCategory.PAYMENT); + payment_ll_point.setVisibility(View.GONE); + inputMethodManager.hideSoftInputFromWindow(payment_usepoint_et.getWindowToken(), 0); + payment_usepoint_underline.setBackgroundColor(UiUtil.getColor(context, R.color.color_04)); + payment_usepoint_et.clearComposingText(); // init + usepointText = "0"; + payment_details_tv_total_price.setText("$ " + String.valueOf(total)); + } + } + }); + + payment_btn_payment.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //결제 모듈 + //create addOrderInfo + final AddOrderReq makingAddOrderReq = new AddOrderReq(); + makingAddOrderReq.setStoreId(storeId); + makingAddOrderReq.setUserId(userId); + makingAddOrderReq.setTax(String.valueOf(tax)); + makingAddOrderReq.setPaymethod("0,1,0");//카드 결제 + makingAddOrderReq.setDetail(orderList); + + //add price & usepoint + double amount = total - Integer.parseInt(usepointText); + amount = (int) (amount * 100)/ 100.0; + String amount_total = String.valueOf(amount); + + makingAddOrderReq.setPrice(amount_total); + makingAddOrderReq.setPoints(usepointText); + + LogEventTracker.PaymentBtnEvent(GaCategory.PAYMENT, makingAddOrderReq); + + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + tvTitle.setText(getResources().getString(R.string.popup_payment_confirm_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_confirm_message)); + + Spannable sp = new SpannableString(storeName + "?"); + sp.setSpan(new ForegroundColorSpan(Color.RED), 0, storeName.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + tvSubMessage.setText(sp); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_confirm_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_confirm_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_confirm_title), + tvRightButton.getText().toString()); + popup.dismiss(); + + //progress execute + progress_ll = (LinearLayout) findViewById(R.id.progress_ll); + progress_iv = (ImageView) findViewById(R.id.progress_iv); + GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(progress_iv); + Glide.with(context).load(R.raw.img_loading_gif).into(imageViewTarget); + progress_ll.setVisibility(View.VISIBLE); + + //send order/add API + registerOrder(context, popup, makingAddOrderReq); + + + } + }); + + tvRightButton.setVisibility(View.VISIBLE); + } + }); + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + + if (selectMenuList != null) { + selectMenuList.clear(); + } + } + + private void registerOrder(final Context context, final KioskPopup popup, final AddOrderReq addOrderReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().ordersAddPost(context, addOrderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + AddOrderRes addOrderRes = (AddOrderRes) result; + + LOGE(TAG, "addOrderReq =>" + UiUtil.toStringGson(addOrderReq)); + if (addOrderRes != null && addOrderRes.getResponseStatus().equals(200) + && addOrderRes.getResponseMsg().equals("Success")) { + + LOGD(TAG, "registerOrder success!"); + + //stop progress + progress_ll.setVisibility(View.GONE); + + if (addOrderRes.getData() != null && addOrderRes.getData().getOrderId() != null) { + order_id = addOrderRes.getData().getOrderId(); + } + + checkedStatusPopupRightButton(popup, addOrderReq); + + } + //case sold out + else if (addOrderRes != null && addOrderRes.getResponseStatus().equals(200) + && addOrderRes.getResponseMsg().equals("Not exist contents")) { //TODO: 서버 미구현임으로 TEST할때 Success 바꿔서 + + if (addOrderRes.getData().getSoldOut() != null) { + final List soldOutList = addOrderRes.getData().getSoldOut(); + + //sold out popup + final KioskPopup soldout_popup = new KioskPopup(context); + soldout_popup.show(); + TextView tvTitle = (TextView) soldout_popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) soldout_popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) soldout_popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvRightButton); + tvRightButton.setVisibility(View.GONE); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_sold_out)); + tvLeftButton.setText(getResources().getString(R.string.popup_sold_out_left_btn)); + tvTitle.setText(getResources().getString(R.string.popup_sold_out_title)); + + StringBuffer soldOutBuffer = new StringBuffer(); + for (AddOrderResDataSoldOut soldOut : soldOutList) { + soldOutBuffer.append(soldOut.getMenuName() + "\n"); + } + tvMessage.setText(soldOutBuffer.toString()); + tvMessage.setTextColor(Color.RED); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_sold_out_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_sold_out_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + soldout_popup.dismiss(); + + //Delete fail menu item + for(int i = 0; i < soldOutList.size(); i ++) { + for (int j = 0; j < selectMenuList.size(); j ++) { + + if (selectMenuList.get(j).getMenu_id().equals(soldOutList.get(i).getMenuId())) { + selectMenuList.remove(j); + break; + } + } + } + + checkedSoldoutType(selectMenuList); + } + }); + } else { + //TODO: TEST CODE + /** + * option activity (dessert) + * menu_id => 6cf9a37b-fde9-4832-8532-2e134cb68c40, menu_name => COOKIE + * + * history detail activity (2017-04-28 12:02:24) + * menu_id => 6072c7ce-c0e8-4bca-8992-c4d6240d0cd2, menu_name => Classic Reuben + * + * cart activity (fruit) + * menu_id => 0243d5f6-3e81-48fc-819c-6dabd72555cc, menu_name => ORANGE + */ + + AddOrderResDataSoldOut testSoldOut = new AddOrderResDataSoldOut(); + testSoldOut.setMenuId("6cf9a37b-fde9-4832-8532-2e134cb68c40"); + testSoldOut.setMenuName("COOKIE"); + + List testSoldOutList = new ArrayList(); + testSoldOutList.add(testSoldOut); + + AddOrderResData testOrderData = new AddOrderResData(); + testOrderData.setSoldOut(testSoldOutList); + + addOrderRes.setData(testOrderData); + final List soldOutList = addOrderRes.getData().getSoldOut(); + + //sold out popup + final KioskPopup soldout_popup = new KioskPopup(context); + soldout_popup.show(); + TextView tvTitle = (TextView) soldout_popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) soldout_popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) soldout_popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) soldout_popup.getContentView().findViewById(R.id.tvRightButton); + tvRightButton.setVisibility(View.GONE); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_sold_out)); + tvLeftButton.setText(getResources().getString(R.string.popup_sold_out_left_btn)); + tvTitle.setText(getResources().getString(R.string.popup_sold_out_title)); + + StringBuffer soldOutBuffer = new StringBuffer(); + for (AddOrderResDataSoldOut soldOut : soldOutList) { + soldOutBuffer.append(soldOut.getMenuName() + "\n"); + } + tvMessage.setText(soldOutBuffer.toString()); + tvMessage.setTextColor(Color.RED); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_sold_out_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_sold_out_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + + //Delete fail menu item + for(int i = 0; i < soldOutList.size(); i ++) { + for (int j = 0; j < selectMenuList.size(); j ++) { + + if (selectMenuList.get(j).getMenu_id().equals(soldOutList.get(i).getMenuId())) { + selectMenuList.remove(j); + break; + } + } + } + + checkedSoldoutType(selectMenuList); + } + }); + + } + }else { + + //500 error + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + tvRightButton.setVisibility(View.GONE); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_cantorder)); + tvLeftButton.setText(getResources().getString(R.string.popup_can_not_order_left_btn)); + tvTitle.setText(getResources().getString(R.string.popup_can_not_order_title)); + tvMessage.setText(getResources().getString(R.string.popup_can_not_order_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_can_not_order_sub_message)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_can_not_order_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_can_not_order_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + onBackPressed(); + } + }); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + private void checkedStatusPopupRightButton(final KioskPopup popup, final AddOrderReq addOrderReq) { + + if (NetworkManager.isNetworkOnline()) { + + Intent paymentIntent = new Intent(context, PaymentWebView.class); + paymentIntent.putExtra("amount", addOrderReq.getPrice()); + paymentIntent.putExtra("paymentInfo", UiUtil.toStringGson(addOrderReq)); + paymentIntent.putExtra("order_id", order_id); + paymentIntent.putExtra("tax", addOrderReq.getTax()); + paymentIntent.putExtra("points", addOrderReq.getPoints()); + startActivity(paymentIntent); + popup.dismiss(); + + } else { + Toast.makeText(context, getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + //popup + final KioskPopup pyPopup = new KioskPopup(context); + pyPopup.show(); + TextView tvTitle = (TextView) pyPopup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) pyPopup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) pyPopup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) pyPopup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) pyPopup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) pyPopup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_payment_error)); + tvLeftButton.setText(getResources().getString(R.string.popup_payment_error_left_btn)); + tvRightButton.setText(getResources().getString(R.string.popup_payment_error_right_btn)); + tvTitle.setText(getResources().getString(R.string.popup_payment_error_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_error_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_payment_error_sub_message)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvLeftButton.getText().toString()); + pyPopup.dismiss(); + popup.dismiss(); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvRightButton.getText().toString()); + + if (NetworkManager.isNetworkOnline()) { + + pyPopup.dismiss(); + popup.dismiss(); + + Intent paymentIntent = new Intent(context, PaymentWebView.class); + paymentIntent.putExtra("amount", addOrderReq.getPrice()); + paymentIntent.putExtra("paymentInfo", UiUtil.toStringGson(addOrderReq)); + paymentIntent.putExtra("order_id", order_id); + paymentIntent.putExtra("tax", addOrderReq.getTax()); + paymentIntent.putExtra("points", addOrderReq.getPoints()); + startActivity(paymentIntent); + + } else { + + pyPopup.dismiss(); + popup.dismiss(); + + pyPopup.show(); + Toast.makeText(context, getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + }); + } + } + + + private void getOrderHistory(final Context context, final OrderReq orderReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().orderPaymentListPost(context, orderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + OrderRes orderRes = (OrderRes) result; + + if (orderRes.getResponseStatus() != null && orderRes.getResponseStatus().equals(200)) { + + String orderInfo = UiUtil.toStringGson(orderRes.getData().get(0)); + String impossible_order = "true"; + + Intent reorderIntent = new Intent(context, TicketActivity.class); + reorderIntent.putExtra("clicked_order", orderInfo); + reorderIntent.putExtra("impossible_order", impossible_order); + reorderIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + reorderIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(reorderIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_choose_other_menus), Toast.LENGTH_SHORT).show(); + //finish(); + + } else { + LOGE(TAG, "getOrderHistory error !"); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + private void checkedSoldoutType(ArrayList selectMenuList) { + /** + * checkedIntentFlag + * type 1 : from menu option Activity + * type 2 : from cart Activity + * type 3 : from order history detail Activity + */ + if (selectMenuList.size() > 0) { + + switch (checkedIntentFlag) { + + case 1: + Intent optionIntent = getIntent(); + finish(); + optionIntent.putExtra("selectMenuList", selectMenuList); + startActivity(optionIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_menu_removed), Toast.LENGTH_SHORT).show(); + break; + case 2: + if (KioskPreference.getInstance().getCartInfo() != null) { + KioskPreference.getInstance().clearCartInfo(); + + for (CartMenuItem cartMenuItem : selectMenuList) { + KioskPreference.getInstance().setCartInfo(cartMenuItem); + } + } + Intent cartIntent = new Intent(context, CartMenuActivity.class); + cartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + cartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(cartIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_menu_removed), Toast.LENGTH_SHORT).show(); + break; + case 3: + Intent historyDetailIntent = getIntent(); + finish(); + historyDetailIntent.putExtra("selectMenuList", selectMenuList); + startActivity(historyDetailIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_menu_removed), Toast.LENGTH_SHORT).show(); + break; + + default: + LOGE(TAG, "ERROR"); + break; + } + } else { + + switch (checkedIntentFlag) { + + case 1: + Intent categoryIntent = new Intent(context, SubCategoryActivity.class); + categoryIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + categoryIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(categoryIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_choose_other_menus), Toast.LENGTH_SHORT).show(); + break; + case 2: + if (KioskPreference.getInstance().getCartInfo() != null) { + KioskPreference.getInstance().clearCartInfo(); + } + Intent cartIntent = new Intent(context, CartMenuActivity.class); + cartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + cartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(cartIntent); + Toast.makeText(context, getResources().getString(R.string.soldout_menu_removed), Toast.LENGTH_SHORT).show(); + break; + case 3: + + OrderReq orderReq = new OrderReq(); + orderReq.setUserId(userId); + orderReq.setStoreId(storeId); + orderReq.setOrderId(order_id); + + getOrderHistory(context, orderReq); + break; + + default: + LOGE(TAG, "ERROR"); + break; + } + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentAdapter.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentAdapter.java new file mode 100644 index 0000000..035b95c --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentAdapter.java @@ -0,0 +1,113 @@ +package net.bluehack.kiosk.payment; + +import android.content.Context; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; +import net.bluehack.kiosk.util.UiUtil; + +import java.util.ArrayList; +import java.util.List; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PaymentAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(PaymentAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public PaymentAdapter(Context context) { + this.context = context; + } + + @Override + public PaymentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.payment_menu_item, parent, false); + return new PaymentViewHolder(v); + } + + @Override + public void onBindViewHolder(PaymentViewHolder holder, final int position) { + + final CartMenuItem cartMenuItem = list.get(position); + final List requireOptionItems = cartMenuItem.getCartMenuRequireOptionItems(); + final List cartMenuOptionItem = cartMenuItem.getCartMenuOptionItems(); + + //cart menu option view + + //required option + RecyclerView.LayoutManager requiredOptionLayoutManager = new LinearLayoutManager(context); + PaymentMenuRequiredOptionAdapter paymentMenuRequiredOptionAdapter = new PaymentMenuRequiredOptionAdapter(context); + holder.payment_required_option_rv_list.setHasFixedSize(true); + holder.payment_required_option_rv_list.setLayoutManager(requiredOptionLayoutManager); + holder.payment_required_option_rv_list.setAdapter(paymentMenuRequiredOptionAdapter); + + paymentMenuRequiredOptionAdapter.clean(); + paymentMenuRequiredOptionAdapter.addItem(requireOptionItems); + paymentMenuRequiredOptionAdapter.notifyDataSetChanged(); + + //choice option + RecyclerView.LayoutManager optionLayoutManager = new LinearLayoutManager(context); + PaymentMenuOptionAdapter paymentMenuOptionAdapter = new PaymentMenuOptionAdapter(context); + holder.payment_option_rv_list.setHasFixedSize(true); + holder.payment_option_rv_list.setLayoutManager(optionLayoutManager); + holder.payment_option_rv_list.setAdapter(paymentMenuOptionAdapter); + + paymentMenuOptionAdapter.clean(); + paymentMenuOptionAdapter.addItem(cartMenuOptionItem); + paymentMenuOptionAdapter.notifyDataSetChanged(); + + final String url = UiUtil.getFileImgUrl(); + Glide.with(context) + .load(url + cartMenuItem.getMenu_image()) + .override(56, 56) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_menu_sample_a_default) + .into(holder.payment_menu_card_iv_img); + + String point = "0"; + if (cartMenuItem.getMenu_point() != null) { + point = cartMenuItem.getMenu_point(); + } + holder.payment_menu_card_tv_title.setText(cartMenuItem.getMenu_name()); + holder.payment_menu_card_tv_price.setText("$ " + cartMenuItem.getMenu_price()); + + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionAdapter.java new file mode 100644 index 0000000..18f3745 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionAdapter.java @@ -0,0 +1,67 @@ +package net.bluehack.kiosk.payment; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; + +import java.util.ArrayList; +import java.util.List; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PaymentMenuOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(PaymentMenuOptionAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public PaymentMenuOptionAdapter(Context context) { + this.context = context; + } + + @Override + public PaymentMenuOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.payment_option_item, parent, false); + return new PaymentMenuOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(PaymentMenuOptionViewHolder holder, final int position) { + + final CartMenuOptionItem cartMenuOptionItem = list.get(position); + + holder.payment_menu_option_tv_title.setText(cartMenuOptionItem.getMenu_option_name()); + holder.payment_menu_option_price.setText("+ $" + cartMenuOptionItem.getMenu_option_price()); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionViewHolder.java new file mode 100644 index 0000000..85400c4 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuOptionViewHolder.java @@ -0,0 +1,23 @@ +package net.bluehack.kiosk.payment; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class PaymentMenuOptionViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + TextView payment_menu_option_tv_title; + TextView payment_menu_option_price; + + public PaymentMenuOptionViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.payment_menu_option_card_view); + this.payment_menu_option_tv_title = (TextView) itemView.findViewById(R.id.payment_menu_option_tv_title); + this.payment_menu_option_price = (TextView) itemView.findViewById(R.id.payment_menu_option_price); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionAdapter.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionAdapter.java new file mode 100644 index 0000000..7d5f55f --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionAdapter.java @@ -0,0 +1,69 @@ +package net.bluehack.kiosk.payment; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.cart.vo.CartMenuOptionItem; +import net.bluehack.kiosk.cart.vo.CartMenuRequireOptionItem; + +import java.util.ArrayList; +import java.util.List; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PaymentMenuRequiredOptionAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(PaymentMenuRequiredOptionAdapter.class); + + private Context context; + private List list = new ArrayList<>(); + + public PaymentMenuRequiredOptionAdapter(Context context) { + this.context = context; + } + + @Override + public PaymentMenuRequiredOptionViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.payment_required_option_item, parent, false); + return new PaymentMenuRequiredOptionViewHolder(v); + } + + @Override + public void onBindViewHolder(PaymentMenuRequiredOptionViewHolder holder, final int position) { + + final CartMenuRequireOptionItem cartMenuOptionItem = list.get(position); + + holder.payment_menu_required_option_tv_title.setText(cartMenuOptionItem.getMenu_rq_option_name()); + holder.payment_menu_required_option_price.setText("+ $" + cartMenuOptionItem.getMenu_rq_option_price()); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionViewHolder.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionViewHolder.java new file mode 100644 index 0000000..92d23db --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentMenuRequiredOptionViewHolder.java @@ -0,0 +1,23 @@ +package net.bluehack.kiosk.payment; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class PaymentMenuRequiredOptionViewHolder extends RecyclerView.ViewHolder { + + CardView payment_menu_required_option_card_view; + TextView payment_menu_required_option_tv_title; + TextView payment_menu_required_option_price; + + public PaymentMenuRequiredOptionViewHolder(View itemView) { + super(itemView); + + this.payment_menu_required_option_card_view = (CardView) itemView.findViewById(R.id.payment_menu_required_option_card_view); + this.payment_menu_required_option_tv_title = (TextView) itemView.findViewById(R.id.payment_menu_required_option_tv_title); + this.payment_menu_required_option_price = (TextView) itemView.findViewById(R.id.payment_menu_required_option_price); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentViewHolder.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentViewHolder.java new file mode 100644 index 0000000..df47cd1 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentViewHolder.java @@ -0,0 +1,32 @@ +package net.bluehack.kiosk.payment; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +import de.hdodenhof.circleimageview.CircleImageView; + +public class PaymentViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + CircleImageView payment_menu_card_iv_img; + TextView payment_menu_card_tv_title; + TextView payment_menu_card_tv_price; + RecyclerView payment_required_option_rv_list; + RecyclerView payment_option_rv_list; + + public PaymentViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.payment_menu_card_view); + this.payment_menu_card_iv_img = (CircleImageView) itemView.findViewById(R.id.payment_menu_card_iv_img); + this.payment_menu_card_tv_title = (TextView) itemView.findViewById(R.id.payment_menu_card_tv_title); + this.payment_menu_card_tv_price = (TextView) itemView.findViewById(R.id.payment_menu_card_tv_price); + this.payment_required_option_rv_list = (RecyclerView) itemView.findViewById(R.id.payment_required_option_rv_list); + this.payment_option_rv_list = (RecyclerView) itemView.findViewById(R.id.payment_option_rv_list); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/payment/PaymentWebView.java b/app/src/main/java/net/bluehack/kiosk/payment/PaymentWebView.java new file mode 100644 index 0000000..3913940 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/payment/PaymentWebView.java @@ -0,0 +1,469 @@ +package net.bluehack.kiosk.payment; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.view.KeyEvent; +import android.view.View; +import android.webkit.CookieManager; +import android.webkit.JavascriptInterface; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; +import com.google.gson.Gson; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.home.HomeActivity; + +import net.bluehack.kiosk.home.ticket.TicketActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.UiUtil; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.AddOrderReq; +import io.swagger.client.model.OrderCompleteReq; +import io.swagger.client.model.OrderCompleteRes; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.OrderRes; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PaymentWebView extends BaseActivity { + + private final Handler handler = new Handler(); + private static final String TAG = makeLogTag(PaymentWebView.class); + private Context context; + private WebView webView; + private LinearLayout progress_ll; + private ImageView progress_iv; + private AddOrderReq addOrderReq = new AddOrderReq(); + private String amount = ""; + private String order_id = ""; + private String orderCompleteTax = "0"; + private String orderCompletePoints = "0"; + private boolean isLoadingChecked = false; + private static final int TIMEOUT = 30000; + private final String pk = UiUtil.getClearentPK(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.payment_webview); + + context = this; + + setLayout(); + + Intent intent = getIntent(); + if (intent.getSerializableExtra("paymentInfo") != null) { + String paymentInfo = intent.getExtras().getString("paymentInfo"); + Gson gson = new Gson(); + addOrderReq = gson.fromJson(paymentInfo, AddOrderReq.class); + intent.removeExtra("paymentInfo"); + } + if (intent != null) { + amount = intent.getExtras().getString("amount"); + amount = String.format("%.2f", Double.valueOf(amount)); + order_id = intent.getExtras().getString("order_id"); + orderCompleteTax = intent.getExtras().getString("tax"); + orderCompletePoints = intent.getExtras().getString("points"); + + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webView.getSettings().setDomStorageEnabled(true); + webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + CookieManager cookieManager = CookieManager.getInstance(); + cookieManager.setAcceptCookie(true); + cookieManager.setAcceptThirdPartyCookies(webView, true); + } + + webView.loadUrl("http://kiosk-payment-ui.s3-website.ap-northeast-2.amazonaws.com?pk="+pk+"&amount="+amount); + + + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) { + webView.goBack(); + LogEventTracker.CloseWebViewEvent(GaCategory.PAYMENT_WEB); + return true; + } + return super.onKeyDown(keyCode, event); + } + + private void setLayout(){ + + progress_ll = (LinearLayout) findViewById(R.id.progress_ll); + progress_iv = (ImageView) findViewById(R.id.progress_iv); + GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(progress_iv); + Glide.with(this).load(R.raw.img_loading_gif).into(imageViewTarget); + + webView = (WebView) findViewById(R.id.webview); + webView.getSettings().setJavaScriptEnabled(true); + webView.addJavascriptInterface(new AndroidBridge(), "AndroidBridge"); + + webView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + return super.shouldOverrideUrlLoading(view, request); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + + progress_ll.setVisibility(View.VISIBLE); + + //mix 30sec timeout + final Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + if (!isLoadingChecked) { + //Toast.makeText(context, "network error", Toast.LENGTH_SHORT).show(); + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_payment_error)); + tvLeftButton.setText(getResources().getString(R.string.popup_payment_error_left_btn)); + tvRightButton.setText(getResources().getString(R.string.popup_payment_error_right_btn)); + tvTitle.setText(getResources().getString(R.string.popup_payment_error_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_error_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_payment_error_sub_message)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, context.getResources().getString(R.string.popup_payment_error_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + runOnUiThread(new Runnable() { + @Override + public void run() { + onBackPressed(); + } + }); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvRightButton.getText().toString()); + popup.dismiss(); + webView.loadUrl("http://kiosk-payment-ui.s3-website.ap-northeast-2.amazonaws.com?pk="+pk+"&amount="+amount); + } + }); + } + } + }, TIMEOUT); + } + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + + isLoadingChecked = true; + progress_ll.setVisibility(View.GONE); + LogEventTracker.OpenWebViewEvent(GaCategory.PAYMENT_WEB); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + + //Toast.makeText(context, "network error", Toast.LENGTH_SHORT).show(); + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_payment_error)); + tvLeftButton.setText(getResources().getString(R.string.popup_payment_error_left_btn)); + tvRightButton.setText(getResources().getString(R.string.popup_payment_error_right_btn)); + tvTitle.setText(getResources().getString(R.string.popup_payment_error_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_error_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_payment_error_sub_message)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title)); + + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + runOnUiThread(new Runnable() { + @Override + public void run() { + onBackPressed(); + } + }); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvRightButton.getText().toString()); + popup.dismiss(); + webView.loadUrl("http://kiosk-payment-ui.s3-website.ap-northeast-2.amazonaws.com?pk="+pk+"&amount="+amount); + } + }); + + } + }); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + webView.clearHistory(); + webView.clearCache(true); + + } + + private class AndroidBridge { + @JavascriptInterface + public void clearentCancel() { + LOGE(TAG, "close webview"); + LogEventTracker.CloseWebViewEvent(GaCategory.PAYMENT_WEB); + finish(); + + } + + @JavascriptInterface + public void showResponse(String response) { + //Toast.makeText(context, response, Toast.LENGTH_SHORT).show(); + LOGE(TAG, "response =>" + response); + + if (response.equals("200")) { + + String orderCompletePrice = "0"; + String orderCompleteCard = "0"; + if (addOrderReq != null) { + + if (addOrderReq.getPrice() != null) { + orderCompletePrice = addOrderReq.getPrice(); + orderCompleteCard = addOrderReq.getPrice(); + } + } + OrderCompleteReq orderCompleteReq = new OrderCompleteReq(); + orderCompleteReq.setOrderId(order_id); + orderCompleteReq.setStoreId(addOrderReq.getStoreId()); + orderCompleteReq.setUserId(addOrderReq.getUserId()); + orderCompleteReq.setPrice(orderCompletePrice); + orderCompleteReq.setCard(orderCompleteCard); + orderCompleteReq.setPoints(orderCompletePoints); + orderCompleteReq.setTax(orderCompleteTax); + completedOrder(context, orderCompleteReq); + + } else { + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_payment_error)); + tvLeftButton.setText(getResources().getString(R.string.popup_payment_error_left_btn)); + tvRightButton.setText(getResources().getString(R.string.popup_payment_error_right_btn)); + tvTitle.setText(getResources().getString(R.string.popup_payment_error_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_error_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_payment_error_sub_message)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title)); + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + runOnUiThread(new Runnable() { + @Override + public void run() { + onBackPressed(); + } + }); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_error_title), + tvRightButton.getText().toString()); + popup.dismiss(); + } + }); + } + + } + } + + private void completedOrder(final Context context, final OrderCompleteReq orderCompleteReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().ordersPaymentCompletePost(context, orderCompleteReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + OrderCompleteRes orderCompleteRes = (OrderCompleteRes) result; + + if (orderCompleteRes != null && orderCompleteRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "registerOrder success!"); + + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + tvRightButton.setVisibility(View.GONE); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_payment_complete)); + tvLeftButton.setText(getResources().getString(R.string.popup_payment_success_left_btn)); + tvTitle.setText(getResources().getString(R.string.popup_payment_success_title)); + tvMessage.setText(getResources().getString(R.string.popup_payment_success_message)); + tvSubMessage.setText(getResources().getString(R.string.popup_payment_success_sub_message_01) + + " " + addOrderReq.getPoints() + " " + + getResources().getString(R.string.popup_payment_success_sub_message_02)); + tvSubMessage.setTextColor(Color.RED); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_success_title)); + + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_payment_success_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + OrderReq orderReq = new OrderReq(); + orderReq.setStoreId(addOrderReq.getStoreId()); + orderReq.setUserId(addOrderReq.getUserId()); + orderReq.setOrderId(order_id); + + getOrderHistory(context, orderReq); + } + }); + + } else { + Toast.makeText(getApplicationContext(), "server error", Toast.LENGTH_SHORT).show(); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + private void getOrderHistory(final Context context, final OrderReq orderReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().orderPaymentListPost(context, orderReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + OrderRes orderRes = (OrderRes) result; + + if (orderRes.getResponseStatus() != null && orderRes.getResponseStatus().equals(200)) { + + String orderInfo = UiUtil.toStringGson(orderRes.getData().get(0)); + + Intent ticketIntent = new Intent(context, TicketActivity.class); + ticketIntent.putExtra("clicked_order", orderInfo); + ticketIntent.putExtra("isCheckedGoHome", "true"); + ticketIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + ticketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(ticketIntent); + + } else { + LOGE(TAG, "getOrderHistory error !"); + } + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/popup/CompletedStatusPopup.java b/app/src/main/java/net/bluehack/kiosk/popup/CompletedStatusPopup.java new file mode 100644 index 0000000..c051ef7 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/popup/CompletedStatusPopup.java @@ -0,0 +1,95 @@ +package net.bluehack.kiosk.popup; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.Color; +import android.os.Bundle; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.style.ForegroundColorSpan; +import android.view.View; +import android.view.Window; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.UiUtil; + +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class CompletedStatusPopup extends BaseActivity { + + private static final String TAG = makeLogTag(CompletedStatusPopup.class); + private Context context; + private LinearLayout llPopup; + private TextView tvTitle; + private ImageView ivImage; + private TextView tvMessage; + private TextView tvSubMessage; + private TextView tvLeftButton; + private TextView tvRightButton; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE); + setContentView(R.layout.popup_two_button); + + context = this; + + llPopup = (LinearLayout) findViewById(R.id.llPopup); + tvTitle = (TextView) findViewById(R.id.tvTitle); + ivImage = (ImageView) findViewById(R.id.ivImage); + tvMessage = (TextView) findViewById(R.id.tvMessage); + tvSubMessage = (TextView) findViewById(R.id.tvSubMessage); + tvLeftButton = (TextView) findViewById(R.id.tvLeftButton); + tvRightButton = (TextView) findViewById(R.id.tvRightButton); + + Intent intent = getIntent(); + StringBuffer order_num = new StringBuffer(); + order_num.append("("); + if (intent.getExtras().getString("order_num") != null) { + order_num.append(intent.getExtras().getString("order_num")); + } + order_num.append(")"); + + llPopup.setBackground(UiUtil.getDrawable(context, R.color.color_03)); + tvTitle.setText(getResources().getString(R.string.popup_complete_title)); + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_complete_menu)); + + String message_01 = getResources().getString(R.string.popup_complete_message_01); + String message_02 = getResources().getString(R.string.popup_complete_message_02); + + Spannable sp = new SpannableString(order_num.toString()); + sp.setSpan(new ForegroundColorSpan(Color.RED), 0, order_num.toString().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + + tvMessage.setText(message_01 + sp.toString() + message_02); + tvSubMessage.setVisibility(View.GONE); + + tvLeftButton.setText(getResources().getString(R.string.popup_complete_left_btn)); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_complete_title)); + + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_complete_title), + tvLeftButton.getText().toString()); + onBackPressed(); + } + }); + tvRightButton.setVisibility(View.GONE); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/popup/KioskPopup.java b/app/src/main/java/net/bluehack/kiosk/popup/KioskPopup.java new file mode 100644 index 0000000..11ff329 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/popup/KioskPopup.java @@ -0,0 +1,99 @@ +package net.bluehack.kiosk.popup; + +import android.app.AlertDialog; +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.LinearLayout; + +import net.bluehack.kiosk.R; + +public class KioskPopup { + + private Context context; + private AlertDialog alertDialog; + private KioskPopup.Builder builder; + + private boolean hasShow = false; + private View contentView; + + public KioskPopup(Context context) { + this.context = context; + } + + public void show() { + if (!hasShow) { + builder = new Builder(); + } else { + alertDialog.show(); + alertDialog.getWindow() + .clearFlags( + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | + WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); + } + + hasShow = true; + } + + public View getContentView() { + return contentView; + } + + public void dismiss() { + try { + alertDialog.dismiss(); + } catch (IllegalArgumentException e) { + // Activity 종료 후 dismiss + } + } + + public class Builder { + + private Window alertdialogwindow; + + + public void setContentView(View contentView) { + ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + contentView.setLayoutParams(layoutParams); + + LinearLayout linearLayout + = (LinearLayout) alertdialogwindow.findViewById(R.id.llPopup); + if (linearLayout != null) { + linearLayout.removeAllViews(); + linearLayout.addView(contentView); + } + } + + public Builder() { + + AlertDialog.Builder builder = new AlertDialog.Builder(context); + + LayoutInflater inflater + = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + contentView = inflater.inflate(R.layout.popup_two_button, null); + + contentView.setFocusable(true); + contentView.setFocusableInTouchMode(true); + + builder.setView(contentView); + alertDialog = builder.create(); + + try { + alertDialog.show(); + } catch (WindowManager.BadTokenException e) { + return; + } catch (Exception e) { + return; + } + + // 밖 영역을 선택하는 경우 처리 + alertDialog.setCancelable(false); + + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/process/ProcessActivity.java b/app/src/main/java/net/bluehack/kiosk/process/ProcessActivity.java deleted file mode 100644 index 473f6fe..0000000 --- a/app/src/main/java/net/bluehack/kiosk/process/ProcessActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.bluehack.kiosk.process; - -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; - -import net.bluehack.kiosk.R; - -public class ProcessActivity extends AppCompatActivity { - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_process); - - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/store/StoreActivity.java b/app/src/main/java/net/bluehack/kiosk/store/StoreActivity.java index e154ddd..2c34b6b 100644 --- a/app/src/main/java/net/bluehack/kiosk/store/StoreActivity.java +++ b/app/src/main/java/net/bluehack/kiosk/store/StoreActivity.java @@ -1,529 +1,174 @@ package net.bluehack.kiosk.store; -import android.Manifest; +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + import android.app.Activity; import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.pm.PackageManager; - -import android.location.Address; -import android.location.Geocoder; -import android.location.Location; -import android.location.LocationManager; -import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.ActivityCompat; -import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; -import android.util.Log; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; import android.widget.Toast; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.GoogleApiClient; - -import com.google.android.gms.location.LocationListener; -import com.google.android.gms.location.LocationRequest; -import com.google.android.gms.location.LocationServices; -import com.google.android.gms.location.places.Places; -import com.google.android.gms.maps.GoogleMap; -import com.google.android.gms.maps.MapFragment; -import com.google.android.gms.maps.OnMapReadyCallback; -import com.google.android.gms.maps.model.LatLng; - +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; -import java.io.IOException; import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import noman.googleplaces.NRPlaces; -import noman.googleplaces.Place; -import noman.googleplaces.PlaceType; -import noman.googleplaces.PlacesException; -import noman.googleplaces.PlacesListener; +import io.swagger.client.ApiClient; +import io.swagger.client.model.StoresReq; +import io.swagger.client.model.StoresRes; +import io.swagger.client.model.StoresResData; -import static net.bluehack.kiosk.util.Logger.LOGD; -import static net.bluehack.kiosk.util.Logger.LOGE; -import static net.bluehack.kiosk.util.Logger.makeLogTag; - -public class StoreActivity extends Activity implements - GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, - LocationListener, OnMapReadyCallback, PlacesListener { +public class StoreActivity extends BaseActivity { private static final String TAG = makeLogTag(StoreActivity.class); private Context context; - private static GoogleApiClient googleApiClient = null; - private static LocationRequest locationRequest = null; - private static GoogleMap googleMap = null; - private String currentLocationAddress = null; - private static LocationManager locationManager = null; - private static MapFragment mapFragment = null; - private boolean setGPS = false; //현재는 network check - private final int REQUEST_CODE_LOCATION = 2000; - private final int REQUEST_CODE_GPS = 2001; - private static Location location = null; - private final String radius = "1000"; - private final String types = "cafe"; - private static List storeList = new ArrayList(); - private StoreAdapter storeAdapter; - private RecyclerView recyclerView; + private RecyclerView storeRecyclerView; private RecyclerView.LayoutManager layoutManager; - - LatLng SEOUL = new LatLng(37.56, 126.97); - - protected synchronized void buildGoogleApiClient() { - googleApiClient = new GoogleApiClient.Builder(this) - .addConnectionCallbacks(this) - .addOnConnectionFailedListener(this) - .addApi(LocationServices.API) - .addApi(Places.GEO_DATA_API) //place - .addApi(Places.PLACE_DETECTION_API) - .addConnectionCallbacks(this) - .build(); - - googleApiClient.connect(); - } + private KioskPopup popup; + private boolean ischeckedPopup = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(net.bluehack.kiosk.R.layout.activity_store); - context = getApplicationContext(); - locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); - recyclerView = (RecyclerView) findViewById(R.id.store_recommend_list); - recyclerView.setHasFixedSize(true); - mapFragment = (MapFragment) getFragmentManager() - .findFragmentById(R.id.map); - mapFragment.getMapAsync(this); - - storeAdapter = new StoreAdapter(context); - layoutManager = new LinearLayoutManager(this); - recyclerView.setLayoutManager(layoutManager); - recyclerView.setAdapter(storeAdapter); - } - - - public boolean checkLocationPermission() - { - LOGD(TAG, "checkLocationPermission"); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED - && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - - //퍼미션 요청을 위해 UI를 보여줘야 하는지 검사 - if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.ACCESS_FINE_LOCATION)) { - - //Prompt the user once explanation has been shown; - requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_CODE_LOCATION); - - } else - //UI보여줄 필요 없이 요청 - requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_CODE_LOCATION); - - return false; - } else { - - LOGD(TAG, "checkLocationPermission"+"이미 퍼미션 획득한 경우"); - if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !setGPS) - { - LOGD(TAG, "checkLocationPermission Version >= M"); - showGPSDisabledAlertToUser(); - } - - if (googleApiClient == null) { - LOGD(TAG, "checkLocationPermission "+"mGoogleApiClient==NULL"); - buildGoogleApiClient(); - } - else { - LOGD(TAG, "checkLocationPermission "+"mGoogleApiClient!=NULL"); - } - - if ( googleApiClient.isConnected()) { - LOGD(TAG, "checkLocationPermission"+"mGoogleApiClient 연결되 있음"); - } - else { - LOGD(TAG, "checkLocationPermission"+"mGoogleApiClient 끊어져 있음"); - } - - - googleApiClient.reconnect();//이미 연결되 있는 경우이므로 다시 연결 - - googleMap.setMyLocationEnabled(true); - } - } - else { - if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !setGPS) - { - LOGD(TAG, "checkLocationPermission Version < M"); - showGPSDisabledAlertToUser(); - } - - if (googleApiClient == null) { - buildGoogleApiClient(); - } - googleMap.setMyLocationEnabled(true); - } - - return true; - } - - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - switch (requestCode) { - case REQUEST_CODE_LOCATION: { - - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - //퍼미션이 허가된 경우 - if ((ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - || ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED)) { - - if (!locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) && !setGPS || - !locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !setGPS) { - showGPSDisabledAlertToUser(); - } - - if (googleApiClient == null) { - buildGoogleApiClient(); - } - googleMap.setMyLocationEnabled(true); - } - } else { - Toast.makeText(this, "퍼미션 취소", Toast.LENGTH_LONG).show(); - } - return; - } - } - } - - @Override - public void onMapReady(GoogleMap map) - { - googleMap = map; - - googleMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() { - - @Override - public void onMapLoaded() { - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - checkLocationPermission(); - } else { - - if (!locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) && !setGPS || - !locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !setGPS) { - showGPSDisabledAlertToUser(); - } - - if (googleApiClient == null) { - buildGoogleApiClient(); - } - - googleMap.setMyLocationEnabled(true); - } - } - }); - - //구글 플레이 서비스 초기화 - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) - { - if (ActivityCompat.checkSelfPermission( this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - || ActivityCompat.checkSelfPermission( this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) - { - buildGoogleApiClient(); - googleMap.setMyLocationEnabled(true); - } - else - { - /**앱을 삭제할 경우*/ - checkLocationPermission(); - } - } - else - { - buildGoogleApiClient(); - googleMap.setMyLocationEnabled(true); - } - } - - @Override - public void onConnected(Bundle bundle) { - - LOGD(TAG, "onConnected"); - - /**Fixme: @k - * LocationManager - * NETWORK_PROVIDER, GPS_PROVIDER 둘다 기기별 테스트 필요 */ - if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) { - - setGPS = true; - //location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); - - - } else if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { - - setGPS = true; - //location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); - - - }else { - LOGD(TAG, "Can't get locationManager!"); - } - - if ( setGPS && googleApiClient.isConnected() ) { - - locationRequest = new LocationRequest(); - //locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); - locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); - locationRequest.setInterval(1000); - locationRequest.setFastestInterval(1000); - - LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this); - location = LocationServices.FusedLocationApi.getLastLocation(googleApiClient); - LOGD(TAG, "GPS_PROVIDER location:" + location.getLatitude() + "," + location.getLongitude()); - //LOGD(TAG, "GPS_PROVIDER Address:" + findAddress(location)); - if (location != null) { - - new NRPlaces.Builder() - .listener(this) - .key("AIzaSyA7av6NBZ3U-CwHzYMPex2M96OWP1zQz4Y") - .latlng(location.getLatitude(), location.getLongitude()) - .radius(1000) - .type(PlaceType.CAFE) - .build() - .execute(); - } else { - return; - } - } + context = this; + popup = new KioskPopup(context); - if (ActivityCompat.checkSelfPermission( this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - || ActivityCompat.checkSelfPermission( this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { + storeRecyclerView = (RecyclerView) findViewById(R.id.store_rv_list); - if ( !googleApiClient.isConnected()) { - googleApiClient.connect(); - } - } - } - - - @Override - public void onConnectionFailed(ConnectionResult result) { - LOGD(TAG, "Connection failed: ConnectionResult.getErrorCode() = " + result.getErrorCode()); - } - - @Override - public void onConnectionSuspended(int cause) { - LOGD(TAG, "Connection suspended"); - googleApiClient.connect(); - } - - @Override - protected void onStart() { - super.onStart(); + layoutManager = new LinearLayoutManager(this); + storeAdapter = new StoreAdapter(context); - storeAdapter.clean(); - if (googleApiClient != null) { - googleApiClient.connect(); - } + storeRecyclerView.setHasFixedSize(true); + storeRecyclerView.setLayoutManager(layoutManager); + storeRecyclerView.setAdapter(storeAdapter); } @Override - public void onResume() { + protected void onResume() { super.onResume(); - if (googleApiClient != null) { - googleApiClient.connect(); - } - } - - @Override - protected void onStop() { - super.onStop(); - - if (googleApiClient != null && googleApiClient.isConnected()) { - googleApiClient.disconnect(); + if (ischeckedPopup) { + popup.dismiss(); } + getStoreList(context, createStoresReq()); } - @Override - public void onPause() { + protected void onPause() { super.onPause(); - - storeAdapter.clean(); - if ( googleApiClient != null && googleApiClient.isConnected()) { - googleApiClient.disconnect(); - } } - @Override - protected void onDestroy() { - if (googleApiClient != null) { - googleApiClient.unregisterConnectionCallbacks(this); - googleApiClient.unregisterConnectionFailedListener(this); + private StoresReq createStoresReq() { - if (googleApiClient.isConnected()) { - LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, this); - } + StoresReq storesReq = new StoresReq(); - googleApiClient.disconnect(); - googleApiClient = null; + if (KioskPreference.getInstance().getLoginInfo() != null) { + String accountId = KioskPreference.getInstance().getLoginInfo().getAccountId(); + storesReq.setAccountId(accountId); } - - super.onDestroy(); - } - - - @Override - public void onLocationChanged(Location location) { - - LOGD(TAG, "location:" + location.getLatitude() + "," + location.getLongitude()); - } - - //GPS 활성화를 위한 다이얼로그 보여주기 - private void showGPSDisabledAlertToUser() { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); - alertDialogBuilder.setMessage("GPS가 비활성화 되어있습니다. 활성화 할까요?") - .setCancelable(false) - .setPositiveButton("설정", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - Intent callGPSSettingIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); - startActivityForResult(callGPSSettingIntent, REQUEST_CODE_GPS); - } - }); - - alertDialogBuilder.setNegativeButton("취소", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - dialog.cancel(); - } - }); - AlertDialog alert = alertDialogBuilder.create(); - alert.show(); - } - - - //GPS 활성화를 위한 다이얼로그의 결과 처리 - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - - switch (requestCode) { - case REQUEST_CODE_GPS: - - if (locationManager == null) - locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); - - if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { - - setGPS = true; - mapFragment.getMapAsync(this); - } - break; - } - } - - //좌표값 => 주소 변환 - private String findAddress(Location location) { - StringBuffer bf = new StringBuffer(); - Geocoder geocoder = new Geocoder(this, Locale.KOREA); - List
address; - - try { - if (geocoder != null) { - - double lat = location.getLatitude(); - double lng = location.getLongitude(); - - // 세번째 인수는 최대결과값 - address = geocoder.getFromLocation(lat, lng, 1); - - if (address != null && address.size() > 0) { - // 주소 - currentLocationAddress = address.get(0).getAddressLine(0).toString(); - - // 전송할 주소 데이터 (위도/경도 포함 편집) - bf.append(currentLocationAddress).append("#"); - bf.append(lat).append("#"); - bf.append(lng); + return storesReq; + } + + private void getStoreList(final Context context, final StoresReq storesReq) { + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().storesAccountListPost(context, storesReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + StoresRes storesRes = (StoresRes) result; + + if (storesRes.getResponseStatus() != null && storesRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + storeAdapter.clean(); + + ArrayList storeItems = new ArrayList<>(); + + for (StoresResData item : storesRes.getData()) { + + StoresResData storeDataItem = new StoresResData(); + storeDataItem.setSLogo(item.getSLogo()); + storeDataItem.setStore(item.getStore()); + storeDataItem.setSAddress(item.getSAddress()); + storeDataItem.setStoreId(item.getStoreId()); + storeDataItem.setUserId(item.getUserId()); + storeDataItem.setSTax(item.getSTax()); + storeDataItem.setSPhone(item.getSPhone()); + + storeItems.add(storeDataItem); + } + storeAdapter.addItem(storeItems); + storeAdapter.notifyDataSetChanged(); + + } else { + //Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.store_not_found_message), Toast.LENGTH_SHORT).show(); + + popup.show(); + ischeckedPopup = true; + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_store_failed)); + tvTitle.setText(context.getResources().getString(R.string.popup_store_error_title)); + tvMessage.setText(context.getResources().getString(R.string.popup_store_error_message)); + tvSubMessage.setText(context.getResources().getString(R.string.popup_store_error_sub)); + tvRightButton.setText(context.getResources().getString(R.string.popup_store_error_right_btn)); + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_store_error_title)); + + tvLeftButton.setVisibility(View.GONE); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_store_error_title), + tvRightButton.getText().toString()); + popup.dismiss(); + ischeckedPopup = false; + getStoreList(context, createStoresReq()); + } + }); + } + } + }); + } + }).start(); } - } - - } catch (IOException e) { - e.printStackTrace(); + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(),getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); } - return bf.toString(); - } - - @Override - public void onPlacesFailure(PlacesException e) { - LOGE(TAG,"onPlacesFailure()"); - } - - @Override - public void onPlacesStart() { - LOGD(TAG,"onPlacesStart()"); - } - - @Override - public void onPlacesSuccess(final List places) { - LOGD(TAG,"onPlacesSuccess()"); - - runOnUiThread(new Runnable() { - @Override - public void run() { - - for (noman.googleplaces.Place place : places) { - - if (places.size() != 0) { - StoreItem storeItem = new StoreItem(); - int meter = distanceLocation(location.getLatitude(), location.getLongitude(), place.getLatitude(), place.getLongitude()); - LOGD(TAG,"PALCE meter : " + meter); - LOGD(TAG,"PALCE getName : " + place.getName()); - storeItem.setName(place.getName()); - storeItem.setAddress(place.getVicinity()); - storeItem.setMeter(String.valueOf(meter)+"m"); - storeList.add(storeItem); - } else { - LOGE(TAG, "places is null"); - } - } - } - }); - } - - @Override - public void onPlacesFinished() { - LOGD(TAG,"onPlacesFinished()"); - - storeAdapter.addItem(storeList); - storeAdapter.notifyDataSetChanged(); - } - - - public static int distanceLocation(double curLatitude, double curLongitude, double targetLatitude, double targetLngitude) { - - int meter; - Location current = new Location("current"); - Location target = new Location("target"); - - current.setLatitude(curLatitude); - current.setLongitude(curLongitude); - target.setLatitude(targetLatitude); - target.setLongitude(targetLngitude); - - double distance = current.distanceTo(target); - meter = (int) distance; - - return meter; } } diff --git a/app/src/main/java/net/bluehack/kiosk/store/StoreAdapter.java b/app/src/main/java/net/bluehack/kiosk/store/StoreAdapter.java index f6360c7..ee07ecc 100644 --- a/app/src/main/java/net/bluehack/kiosk/store/StoreAdapter.java +++ b/app/src/main/java/net/bluehack/kiosk/store/StoreAdapter.java @@ -1,28 +1,53 @@ package net.bluehack.kiosk.store; +import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; +import static android.content.Intent.FLAG_ACTIVITY_NO_HISTORY; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.graphics.Color; +import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.style.ForegroundColorSpan; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; import net.bluehack.kiosk.R; -import net.bluehack.kiosk.order.OrderActivity; -import net.bluehack.kiosk.order_pay.OrderPayActivity; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.cart.vo.CartMenuItem; +import net.bluehack.kiosk.home.HomeActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.payment.PaymentWebView; +import net.bluehack.kiosk.popup.KioskPopup; +import net.bluehack.kiosk.util.KioskPreference; +import net.bluehack.kiosk.util.UiUtil; import java.util.ArrayList; import java.util.List; -import static net.bluehack.kiosk.util.Logger.LOGE; -import static net.bluehack.kiosk.util.Logger.makeLogTag; +import io.swagger.client.model.OrderReq; +import io.swagger.client.model.StoresResData; -public class StoreAdapter extends RecyclerView.Adapter{ +public class StoreAdapter extends RecyclerView.Adapter { private static final String TAG = makeLogTag(StoreAdapter.class); private Context context; - private static List list = new ArrayList<>(); + private List list = new ArrayList<>(); public StoreAdapter(Context context) { this.context = context; @@ -31,29 +56,87 @@ public StoreAdapter(Context context) { @Override public StoreViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.store_recommend_place_item, parent, false); + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.store_place_item, parent, false); return new StoreViewHolder(v); } @Override - public void onBindViewHolder(StoreViewHolder holder, int position) { - - StoreItem storeItem = list.get(position); - //holder.imageView.setBackground(ContextCompat.getDrawable(context, img)); - holder.name.setText(storeItem.getName()); - holder.address.setText(storeItem.getAddress()); - holder.meter.setText(storeItem.getMeter()); - + public void onBindViewHolder(final StoreViewHolder holder, int position) { + + final StoresResData storeItem = list.get(position); + + Glide.with(context) + .load(storeItem.getSLogo()) + .override(64, 64) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .error(R.drawable.img_storelogo_default) + .centerCrop() + .into(holder.imageView); + holder.name.setText(storeItem.getStore()); + holder.address.setText(storeItem.getSAddress()); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - /**Fixme: @k - * flow 추가시 map 선택으로 바뀔 예정 */ - - Intent intent = new Intent(context, OrderActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); + LOGE(TAG, "store click!"); + LogEventTracker.TapStoreEvent(GaCategory.STORE, storeItem.getStore()); + + final KioskPopup popup = new KioskPopup(context); + popup.show(); + TextView tvTitle = (TextView) popup.getContentView().findViewById(R.id.tvTitle); + ImageView ivImage = (ImageView) popup.getContentView().findViewById(R.id.ivImage); + TextView tvMessage = (TextView) popup.getContentView().findViewById(R.id.tvMessage); + TextView tvSubMessage + = (TextView) popup.getContentView().findViewById(R.id.tvSubMessage); + final TextView tvLeftButton + = (TextView) popup.getContentView().findViewById(R.id.tvLeftButton); + final TextView tvRightButton + = (TextView) popup.getContentView().findViewById(R.id.tvRightButton); + + ivImage.setBackground(UiUtil.getDrawable(context, R.drawable.img_popup_store)); + tvTitle.setText(context.getResources().getString(R.string.popup_select_store_title)); + tvMessage.setText(context.getResources().getString(R.string.popup_select_store_message)); + + String sub_message = storeItem.getStore(); + String sub_end = context.getResources().getString(R.string.popup_select_store_sub); + Spannable sp = new SpannableString(sub_message + sub_end); + sp.setSpan(new ForegroundColorSpan(Color.RED), 0, sub_message.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + tvSubMessage.setText(sp); + + LogEventTracker.OpenPopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_select_store_title)); + + tvLeftButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_select_store_title), + tvLeftButton.getText().toString()); + popup.dismiss(); + } + }); + tvRightButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.ClosePopupEvent(GaCategory.POP_UP, + context.getResources().getString(R.string.popup_select_store_title), + tvRightButton.getText().toString()); + popup.dismiss(); + + //clear cart info + if (KioskPreference.getInstance().getCartInfo() != null) { + KioskPreference.getInstance().clearCartInfo(); + } + + KioskPreference.getInstance().setStoreInfo(storeItem); + Intent intent = new Intent(context, HomeActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + ((Activity) context).finish(); + } + }); } }); } @@ -68,10 +151,12 @@ public int getItemCount() { } public void clean() { - list.clear(); + if (list != null) { + list.clear(); + } } - public void addItem(List itemList) { + public void addItem(List itemList) { if (list instanceof ArrayList) { list = itemList; } else { diff --git a/app/src/main/java/net/bluehack/kiosk/store/StoreItem.java b/app/src/main/java/net/bluehack/kiosk/store/StoreItem.java deleted file mode 100644 index 11d2596..0000000 --- a/app/src/main/java/net/bluehack/kiosk/store/StoreItem.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.bluehack.kiosk.store; - -public class StoreItem { - - private String name; - private String address; - private String latitude; - private String longitude; - private String meter; - - public StoreItem(){} - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getMeter() { - return meter; - } - - public void setMeter(String meter) { - this.meter = meter; - } -} diff --git a/app/src/main/java/net/bluehack/kiosk/store/StoreViewHolder.java b/app/src/main/java/net/bluehack/kiosk/store/StoreViewHolder.java index 483bb94..add97d9 100644 --- a/app/src/main/java/net/bluehack/kiosk/store/StoreViewHolder.java +++ b/app/src/main/java/net/bluehack/kiosk/store/StoreViewHolder.java @@ -3,25 +3,26 @@ import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; import net.bluehack.kiosk.R; +import de.hdodenhof.circleimageview.CircleImageView; + public class StoreViewHolder extends RecyclerView.ViewHolder { CardView cardView; - //ImageView imageView; + CircleImageView imageView; TextView name; TextView address; - TextView meter; public StoreViewHolder(View itemView) { super(itemView); this.cardView = (CardView) itemView.findViewById(R.id.store_card_view); - //this.imageView = (ImageView) itemView.findViewById(R.id.store_); - this.name = (TextView) itemView.findViewById(R.id.store_txt_name); - this.address = (TextView) itemView.findViewById(R.id.store_txt_address); - this.meter = (TextView) itemView.findViewById(R.id.store_txt_meter); + this.imageView = (CircleImageView) itemView.findViewById(R.id.store_iv); + this.name = (TextView) itemView.findViewById(R.id.store_text_name); + this.address = (TextView) itemView.findViewById(R.id.store_text_address); } } diff --git a/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryActivity.java b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryActivity.java new file mode 100644 index 0000000..9d92ada --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryActivity.java @@ -0,0 +1,155 @@ +package net.bluehack.kiosk.subcategory; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import com.google.gson.Gson; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import net.bluehack.kiosk.ApplicationLoader; +import net.bluehack.kiosk.BaseActivity; +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.api.net.NetworkManager; +import net.bluehack.kiosk.cart.CartMenuActivity; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.util.KioskPreference; + +import java.util.ArrayList; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.SubcategoryReq; +import io.swagger.client.model.SubcategoryRes; +import io.swagger.client.model.SubcategoryResData; + +public class SubCategoryActivity extends BaseActivity { + + private static final String TAG = makeLogTag(SubCategoryActivity.class); + private Context context; + private ImageView subcategory_cart; + private TextView menu_cart_tv; + private SubCategoryAdapter subCategoryAdapter; + private RecyclerView subCategoryRecyclerView; + private RecyclerView.LayoutManager layoutManager; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_subcategory); + + context = this; + + subCategoryRecyclerView = (RecyclerView) findViewById(R.id.subcategory_rv_list); + subcategory_cart = (ImageView) findViewById(R.id.subcategory_cart); + menu_cart_tv = (TextView) findViewById(R.id.menu_cart_tv); + + layoutManager = new LinearLayoutManager(this); + subCategoryAdapter = new SubCategoryAdapter(context); + + subCategoryRecyclerView.setHasFixedSize(true); + subCategoryRecyclerView.setLayoutManager(layoutManager); + subCategoryRecyclerView.setAdapter(subCategoryAdapter); + + if (KioskPreference.getInstance().getStoreInfo() != null) { + + String storeId = KioskPreference.getInstance().getStoreInfo().getStoreId(); + SubcategoryReq subcategoryReq = new SubcategoryReq(); + subcategoryReq.setStoreId(storeId); + getSubCategoryList(context, subcategoryReq); + + } else { + //error + Toast.makeText(context, getResources().getString(R.string.subcategory_not_found_list), Toast.LENGTH_SHORT).show(); + } + + subcategory_cart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + LogEventTracker.CartBtnEvent(GaCategory.CATEGORY); + Intent intent = new Intent(context, CartMenuActivity.class); + startActivity(intent); + } + }); + } + + private void getSubCategoryList(final Context context, final SubcategoryReq subcategoryReq) { + + if (NetworkManager.isNetworkOnline()) { + ApiClient.getInstance().categoryListMenuPost(context, subcategoryReq, new ApiClient.ApiResponseListener() { + @Override + public void onResponse(final Object result) { + new Thread(new Runnable() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + SubcategoryRes subcategoryRes = (SubcategoryRes) result; + + Gson gson = new Gson(); + LOGE(TAG, "subcategoryRes result : " + gson.toJson(result)); + + if (subcategoryRes.getResponseStatus() != null && subcategoryRes.getResponseStatus().equals(200)) { + + LOGD(TAG, "login success!"); + + subCategoryAdapter.clean(); + + ArrayList subcategoryResDataItems = new ArrayList<>(); + + for (SubcategoryResData item : subcategoryRes.getData()) { + + SubcategoryResData subcategoryResDataItem = new SubcategoryResData(); + subcategoryResDataItem.setSubCategoryId(item.getSubCategoryId()); + subcategoryResDataItem.setSubCategoryName(item.getSubCategoryName()); + + subcategoryResDataItems.add(subcategoryResDataItem); + } + subCategoryAdapter.addItem(subcategoryResDataItems); + subCategoryAdapter.notifyDataSetChanged(); + + } else { + Toast.makeText(ApplicationLoader.getContext(), "can't get subcategory list.", Toast.LENGTH_SHORT).show(); + } + } + }); + } + }).start(); + } + }); + } else { + //offline + Toast.makeText(ApplicationLoader.getContext(), getResources().getString(R.string.network_status), Toast.LENGTH_SHORT).show(); + } + } + + @Override + protected void onResume() { + super.onResume(); + + if (KioskPreference.getInstance().getCartInfo() != null) { + + if (KioskPreference.getInstance().getCartInfo().size() != 0) { + menu_cart_tv.setVisibility(View.VISIBLE); + } else { + menu_cart_tv.setVisibility(View.INVISIBLE); + } + } + } + + @Override + protected void onPause() { + super.onPause(); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryAdapter.java b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryAdapter.java new file mode 100644 index 0000000..78224b7 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryAdapter.java @@ -0,0 +1,82 @@ +package net.bluehack.kiosk.subcategory; + +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +import android.content.Context; +import android.content.Intent; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.bluehack.kiosk.R; +import net.bluehack.kiosk.log.GaCategory; +import net.bluehack.kiosk.log.LogEventTracker; +import net.bluehack.kiosk.menu.MenuActivity; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.client.model.SubcategoryResData; + +public class SubCategoryAdapter extends RecyclerView.Adapter { + + private static final String TAG = makeLogTag(SubCategoryAdapter.class); + + private Context context; + private static List list = new ArrayList<>(); + + public SubCategoryAdapter(Context context) { + this.context = context; + } + + @Override + public SubCategoryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.subcategory_item, parent, false); + return new SubCategoryViewHolder(v); + } + + @Override + public void onBindViewHolder(SubCategoryViewHolder holder, int position) { + + final SubcategoryResData subcategoryResDataItem = list.get(position); + + holder.name.setText(subcategoryResDataItem.getSubCategoryName()); + holder.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + LogEventTracker.TapCategoryEvent(GaCategory.CATEGORY, subcategoryResDataItem.getSubCategoryName()); + Intent intent = new Intent(context, MenuActivity.class); + intent.putExtra("sub_category_id", subcategoryResDataItem.getSubCategoryId()); + intent.putExtra("sub_category_name", subcategoryResDataItem.getSubCategoryName()); + context.startActivity(intent); + } + }); + } + + @Override + public int getItemCount() { + if (this.list != null) { + return list.size(); + } else { + return 0; + } + } + + public void clean() { + if (list != null) { + list.clear(); + } + } + + public void addItem(List itemList) { + if (list instanceof ArrayList) { + list = itemList; + } else { + LOGE(TAG, "error handler"); + } + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryViewHolder.java b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryViewHolder.java new file mode 100644 index 0000000..7647dff --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/subcategory/SubCategoryViewHolder.java @@ -0,0 +1,24 @@ +package net.bluehack.kiosk.subcategory; + +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import net.bluehack.kiosk.R; + +public class SubCategoryViewHolder extends RecyclerView.ViewHolder { + + CardView cardView; + TextView name; + ImageView imageView; + + public SubCategoryViewHolder(View itemView) { + super(itemView); + + this.cardView = (CardView) itemView.findViewById(R.id.store_card_view); + this.name = (TextView) itemView.findViewById(R.id.subcategory_cv_text_name); + this.imageView = (ImageView) itemView.findViewById(R.id.subcategory_cv_iv_btn); + } +} diff --git a/app/src/main/java/net/bluehack/kiosk/util/KioskPreference.java b/app/src/main/java/net/bluehack/kiosk/util/KioskPreference.java new file mode 100644 index 0000000..fd04a93 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/util/KioskPreference.java @@ -0,0 +1,171 @@ +package net.bluehack.kiosk.util; + +import com.google.gson.Gson; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + +import net.bluehack.kiosk.cart.vo.CartMenuItem; + +import io.swagger.client.model.LoginResData; +import io.swagger.client.model.StoresResData; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.LOGE; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class KioskPreference { + + private static final String TAG = makeLogTag(KioskPreference.class); + private Context context; + + public static final String LOGIN_INFO = "pref_login_info"; + public static final String STORE_INFO = "pref_store_info"; + public static final String CART_INFO = "pref_cart_info"; + + private static ArrayList setCartMenuList = new ArrayList(); + + private static class SingletonHolder { + static final KioskPreference INSTANCE = new KioskPreference(); + } + + public static KioskPreference getInstance() { + return SingletonHolder.INSTANCE; + } + + public void init(Context context) { + this.context = context; + } + + public LoginResData getLoginInfo() { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + String loginText = sp.getString(LOGIN_INFO, null); + //LOGD(TAG, "getStoreInfo =>" + loginText); + Gson gson = new Gson(); + LoginResData loginItem = gson.fromJson(loginText, LoginResData.class); + + return loginItem; + } + + public void setLoginInfo(LoginResData loginResDataItem) { + String loginInfo = UiUtil.toStringGson(loginResDataItem); + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + sp.edit().putString(LOGIN_INFO, loginInfo).apply(); + } + + public void clearLoginInfo() { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + SharedPreferences.Editor editor = sp.edit(); + editor.remove(LOGIN_INFO); + editor.apply(); + } + + public StoresResData getStoreInfo() { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + String storeText = sp.getString(STORE_INFO, null); + //LOGD(TAG, "getStoreInfo =>" + storeText); + Gson gson = new Gson(); + StoresResData storeItem = gson.fromJson(storeText, StoresResData.class); + + return storeItem; + } + + public void setStoreInfo(StoresResData storesResDataItem) { + String storeInfo = UiUtil.toStringGson(storesResDataItem); + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + sp.edit().putString(STORE_INFO, storeInfo).apply(); + } + + public void clearStoreInfo() { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + SharedPreferences.Editor editor = sp.edit(); + editor.remove(STORE_INFO); + editor.apply(); + } + + public ArrayList getCartInfo() { + + ArrayList getCartMenuList = new ArrayList(); + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + String cartList = sp.getString(CART_INFO, null); + + if (cartList == null) { + return null; + } + + try { + JSONArray jsonArray = new JSONArray(cartList); + CartMenuItem item = null; + Gson gson = new Gson(); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + if (jsonObject != null) { + item = gson.fromJson(jsonObject.toString(), CartMenuItem.class); + } + getCartMenuList.add(item); + } + + } catch (JSONException e) { + e.printStackTrace(); + } + return getCartMenuList; + } + + public void setCartInfo(CartMenuItem cartMenuItem) { + + if (getCartInfo() != null) { + setCartMenuList = getCartInfo(); + } + setCartMenuList.add(cartMenuItem); + + ArrayList cartItems = new ArrayList<>(); + for (CartMenuItem cartInfo : setCartMenuList) { + String newCartMenuList = UiUtil.toStringGson(cartInfo); + cartItems.add(newCartMenuList); + } + + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + sp.edit().putString(CART_INFO, cartItems.toString()).apply(); + + } + + public void deleteCartInfo(int index) { + ArrayList cartMenuList = getCartInfo(); + + LOGD(TAG, "deleteCartInfo index =>" + index); + LOGD(TAG, "deleteCartInfo size =>" + cartMenuList.size()); + LOGD(TAG, "deleteCartInfo cartMenuList(index) =>" + cartMenuList.get(index)); + + cartMenuList.remove(index); + + clearCartInfo(); + setCartMenuList = cartMenuList; + + ArrayList cartItems = new ArrayList<>(); + for (CartMenuItem cartInfo : setCartMenuList) { + String newCartMenuList = UiUtil.toStringGson(cartInfo); + cartItems.add(newCartMenuList); + } + + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + sp.edit().putString(CART_INFO, cartItems.toString()).apply(); + } + + public void clearCartInfo() { + + if (setCartMenuList != null) { + setCartMenuList.clear(); + } + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); + SharedPreferences.Editor editor = sp.edit(); + editor.remove(CART_INFO); + editor.apply(); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/util/Logger.java b/app/src/main/java/net/bluehack/kiosk/util/Logger.java index ec84184..a49ee14 100644 --- a/app/src/main/java/net/bluehack/kiosk/util/Logger.java +++ b/app/src/main/java/net/bluehack/kiosk/util/Logger.java @@ -4,7 +4,10 @@ public class Logger { - public Logger(){}; + public Logger() { + } + + ; private static final String LOG_PREFIX = "kiosk_"; private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length(); private static final int MAX_LOG_TAG_LENGTH = 23; diff --git a/app/src/main/java/net/bluehack/kiosk/util/PushWakeLock.java b/app/src/main/java/net/bluehack/kiosk/util/PushWakeLock.java new file mode 100644 index 0000000..070fa71 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/util/PushWakeLock.java @@ -0,0 +1,45 @@ +package net.bluehack.kiosk.util; + +import android.app.KeyguardManager; +import android.content.Context; +import android.os.PowerManager; + +import static net.bluehack.kiosk.util.Logger.LOGD; +import static net.bluehack.kiosk.util.Logger.makeLogTag; + +public class PushWakeLock { + private static final String TAG = makeLogTag(PushWakeLock.class); + private static PowerManager.WakeLock wakeLock; + private static KeyguardManager.KeyguardLock mKeyguardLock; + private static PushWakeLock ourInstance = new PushWakeLock(); + private static boolean isScreenLock; + + public static PushWakeLock getInstance() { + return ourInstance; + } + + public void acquireCpuWakeLock(Context context) { + LOGD(TAG, "acquireCpuWakeLock =>" + wakeLock); + + if (wakeLock != null) { + return; + } + + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + wakeLock = pm.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK | + PowerManager.ACQUIRE_CAUSES_WAKEUP | + PowerManager.ON_AFTER_RELEASE, "hello"); + + wakeLock.acquire(3000); + } + + public void releaseCpuLock() { + LOGD(TAG, "releaseCpuLock =>" + wakeLock); + + if (wakeLock != null) { + wakeLock.release(); + wakeLock = null; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/net/bluehack/kiosk/util/UiUtil.java b/app/src/main/java/net/bluehack/kiosk/util/UiUtil.java new file mode 100644 index 0000000..bd90b23 --- /dev/null +++ b/app/src/main/java/net/bluehack/kiosk/util/UiUtil.java @@ -0,0 +1,76 @@ +package net.bluehack.kiosk.util; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.support.v4.content.ContextCompat; +import android.util.DisplayMetrics; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ListView; + +public class UiUtil { + + public static Drawable getDrawable(Context context, int id) { + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + return context.getDrawable(id); + } else { + return context.getResources().getDrawable(id); + } + } + + public static final int getColor(Context context, int id) { + final int version = Build.VERSION.SDK_INT; + if (version >= 23) { + return ContextCompat.getColor(context, id); + } else { + return context.getResources().getColor(id); + } + } + + public static String toStringGson(Object object) { + Gson gson = new GsonBuilder() + .setPrettyPrinting() + .serializeNulls() + .create(); + return gson.toJson(object); + } + + public static void drawListViewFitHeight(ListView lv, BaseAdapter adapter) { + int totalHeight = 0; + + for (int i = 0; i < adapter.getCount(); i++) { + View listItem = adapter.getView(i, null, lv); + listItem.measure(0, 0); + totalHeight += listItem.getMeasuredHeight(); + } + + ViewGroup.LayoutParams params = lv.getLayoutParams(); + params.height = totalHeight + (lv.getDividerHeight() + * (lv.getCount() - 1)); + lv.setLayoutParams(params); + lv.requestLayout(); + } + + public static int dpToPx(Context context, double dp) { + DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); + return (int) Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); + } + + public static String getFileImgUrl() { + String fileUrl = "http://175.207.13.212:8080/files/down?files_id="; + return fileUrl; + } + + public static String getClearentPK() { + String pk = "307a301406072a8648ce3d020106092b240303020801010c036200048724788baf6bdfd84d4b397" + + "c48b9c646effb8a1e710bc83c6b0c63b0610ff8c3624d8058031bb8002214ca89baf66a9101d0ff8d97" + + "b07e04ca272bc4196185b9cf614d78b2b0ad0de9ca686e07c80cc9022ad835d5f8f4f90ef0202af7ac6ba4"; + return pk; + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/bg_num_round_01.png b/app/src/main/res/drawable-hdpi/bg_num_round_01.png new file mode 100644 index 0000000..3cbb953 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/bg_num_round_01.png differ diff --git a/app/src/main/res/drawable-hdpi/bg_roundbox_gray.9.png b/app/src/main/res/drawable-hdpi/bg_roundbox_gray.9.png deleted file mode 100755 index 71cceca..0000000 Binary files a/app/src/main/res/drawable-hdpi/bg_roundbox_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_roundbox_half_gray.9.png b/app/src/main/res/drawable-hdpi/bg_roundbox_half_gray.9.png deleted file mode 100755 index 80fcb56..0000000 Binary files a/app/src/main/res/drawable-hdpi/bg_roundbox_half_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_roundbox_noline_white.9.png b/app/src/main/res/drawable-hdpi/bg_roundbox_noline_white.9.png deleted file mode 100755 index 9d4a47a..0000000 Binary files a/app/src/main/res/drawable-hdpi/bg_roundbox_noline_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_roundbox_white.9.png b/app/src/main/res/drawable-hdpi/bg_roundbox_white.9.png deleted file mode 100755 index 66fef81..0000000 Binary files a/app/src/main/res/drawable-hdpi/bg_roundbox_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bg_shadow_map.9.png b/app/src/main/res/drawable-hdpi/bg_shadow_map.9.png deleted file mode 100755 index e140fa5..0000000 Binary files a/app/src/main/res/drawable-hdpi/bg_shadow_map.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_arrow_01_nor.png b/app/src/main/res/drawable-hdpi/btn_arrow_01_nor.png deleted file mode 100755 index b42f9a8..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_arrow_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_arrow_down_nor.png b/app/src/main/res/drawable-hdpi/btn_arrow_down_nor.png new file mode 100755 index 0000000..4dce216 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_arrow_down_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_arrow_up_nor.png b/app/src/main/res/drawable-hdpi/btn_arrow_up_nor.png new file mode 100755 index 0000000..1fda966 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_arrow_up_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_check_01_nor.png b/app/src/main/res/drawable-hdpi/btn_check_01_nor.png new file mode 100755 index 0000000..a87a0b3 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_check_01_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_check_01_sel.png b/app/src/main/res/drawable-hdpi/btn_check_01_sel.png new file mode 100755 index 0000000..30d988e Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_check_01_sel.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_alarm_nor.png b/app/src/main/res/drawable-hdpi/btn_main_alarm_nor.png deleted file mode 100755 index 9209c68..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_main_alarm_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_m_o_nor.9.png b/app/src/main/res/drawable-hdpi/btn_main_m_o_nor.9.png deleted file mode 100755 index 06f6a6e..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_main_m_o_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_m_o_pre.9.png b/app/src/main/res/drawable-hdpi/btn_main_m_o_pre.9.png deleted file mode 100755 index b7b4281..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_main_m_o_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_menu_nor.png b/app/src/main/res/drawable-hdpi/btn_main_menu_nor.png old mode 100755 new mode 100644 index 3ec5921..8b6440f Binary files a/app/src/main/res/drawable-hdpi/btn_main_menu_nor.png and b/app/src/main/res/drawable-hdpi/btn_main_menu_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_menu_pre.png b/app/src/main/res/drawable-hdpi/btn_main_menu_pre.png new file mode 100755 index 0000000..b87a772 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_main_menu_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_storechange_nor.png b/app/src/main/res/drawable-hdpi/btn_main_storechange_nor.png new file mode 100644 index 0000000..790b1c7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_main_storechange_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_main_storechange_pre.png b/app/src/main/res/drawable-hdpi/btn_main_storechange_pre.png new file mode 100644 index 0000000..e298437 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_main_storechange_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_cart_nor.png b/app/src/main/res/drawable-hdpi/btn_menu_cart_nor.png old mode 100755 new mode 100644 index 8391e27..c3e5942 Binary files a/app/src/main/res/drawable-hdpi/btn_menu_cart_nor.png and b/app/src/main/res/drawable-hdpi/btn_menu_cart_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_cart_pre.png b/app/src/main/res/drawable-hdpi/btn_menu_cart_pre.png new file mode 100644 index 0000000..1d32e79 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_menu_cart_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_close_nor.png b/app/src/main/res/drawable-hdpi/btn_menu_close_nor.png old mode 100755 new mode 100644 diff --git a/app/src/main/res/drawable-hdpi/btn_menu_close_pre.png b/app/src/main/res/drawable-hdpi/btn_menu_close_pre.png new file mode 100644 index 0000000..cfeaded Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_menu_close_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_map_nor.png b/app/src/main/res/drawable-hdpi/btn_menu_map_nor.png deleted file mode 100755 index ce1b7e4..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_menu_map_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_sample_02_big.png b/app/src/main/res/drawable-hdpi/btn_menu_sample_02_big.png deleted file mode 100755 index ae1a6d0..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_menu_sample_02_big.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_menu_search_nor.png b/app/src/main/res/drawable-hdpi/btn_menu_search_nor.png deleted file mode 100755 index 38816d8..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_menu_search_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_num_minus_nor.png b/app/src/main/res/drawable-hdpi/btn_num_minus_nor.png index 561cca1..a60d195 100755 Binary files a/app/src/main/res/drawable-hdpi/btn_num_minus_nor.png and b/app/src/main/res/drawable-hdpi/btn_num_minus_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_num_minus_pre.png b/app/src/main/res/drawable-hdpi/btn_num_minus_pre.png new file mode 100755 index 0000000..527c8b8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_num_minus_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_num_plus_nor.png b/app/src/main/res/drawable-hdpi/btn_num_plus_nor.png index 896c0d8..93edfd6 100755 Binary files a/app/src/main/res/drawable-hdpi/btn_num_plus_nor.png and b/app/src/main/res/drawable-hdpi/btn_num_plus_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_num_plus_pre.png b/app/src/main/res/drawable-hdpi/btn_num_plus_pre.png new file mode 100755 index 0000000..63ab227 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_num_plus_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_otherview_pre.png b/app/src/main/res/drawable-hdpi/btn_otherview_pre.png deleted file mode 100755 index 0a9fe00..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_otherview_pre.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_popup_left_nor.9.png b/app/src/main/res/drawable-hdpi/btn_popup_left_nor.9.png deleted file mode 100755 index 51437de..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_popup_left_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_popup_left_pre.9.png b/app/src/main/res/drawable-hdpi/btn_popup_left_pre.9.png deleted file mode 100755 index e178f21..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_popup_left_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_popup_right_nor.9.png b/app/src/main/res/drawable-hdpi/btn_popup_right_nor.9.png deleted file mode 100755 index cecc1b6..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_popup_right_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_popup_right_pre.9.png b/app/src/main/res/drawable-hdpi/btn_popup_right_pre.9.png deleted file mode 100755 index c6f0937..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_popup_right_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_radio_01_nor.png b/app/src/main/res/drawable-hdpi/btn_radio_01_nor.png new file mode 100755 index 0000000..abab5f7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_radio_01_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_radio_01_sel.png b/app/src/main/res/drawable-hdpi/btn_radio_01_sel.png index de7d5c4..8356615 100755 Binary files a/app/src/main/res/drawable-hdpi/btn_radio_01_sel.png and b/app/src/main/res/drawable-hdpi/btn_radio_01_sel.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_radio_01_unsel.png b/app/src/main/res/drawable-hdpi/btn_radio_01_unsel.png deleted file mode 100755 index 4c28ea1..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_radio_01_unsel.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_re_cart_nor.png b/app/src/main/res/drawable-hdpi/btn_re_cart_nor.png new file mode 100644 index 0000000..915f63b Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_re_cart_nor.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_re_cart_pre.png b/app/src/main/res/drawable-hdpi/btn_re_cart_pre.png new file mode 100644 index 0000000..8568e12 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/btn_re_cart_pre.png differ diff --git a/app/src/main/res/drawable-hdpi/btn_recent_menu_sample_01_nor.png b/app/src/main/res/drawable-hdpi/btn_recent_menu_sample_01_nor.png deleted file mode 100755 index babb2ba..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_recent_menu_sample_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_storechange_01_nor.9.png b/app/src/main/res/drawable-hdpi/btn_storechange_01_nor.9.png deleted file mode 100755 index a656750..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_storechange_01_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_storechange_nor.9.png b/app/src/main/res/drawable-hdpi/btn_storechange_nor.9.png deleted file mode 100755 index 7cb426e..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_storechange_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/btn_storechange_pre.9.png b/app/src/main/res/drawable-hdpi/btn_storechange_pre.9.png deleted file mode 100755 index e6da90f..0000000 Binary files a/app/src/main/res/drawable-hdpi/btn_storechange_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_arrow_mo_guide.png b/app/src/main/res/drawable-hdpi/img_arrow_mo_guide.png new file mode 100755 index 0000000..be32f93 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_arrow_mo_guide.png differ diff --git a/app/src/main/res/drawable-hdpi/img_brand_logo.png b/app/src/main/res/drawable-hdpi/img_brand_logo.png new file mode 100755 index 0000000..0b311ce Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_brand_logo.png differ diff --git a/app/src/main/res/drawable-hdpi/img_category_underline.9.png b/app/src/main/res/drawable-hdpi/img_category_underline.9.png deleted file mode 100755 index e74b7d6..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_category_underline.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_contactus_call.png b/app/src/main/res/drawable-hdpi/img_contactus_call.png new file mode 100644 index 0000000..c9a1987 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_contactus_call.png differ diff --git a/app/src/main/res/drawable-hdpi/img_main_point.png b/app/src/main/res/drawable-hdpi/img_main_point.png new file mode 100644 index 0000000..926a47f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_main_point.png differ diff --git a/app/src/main/res/drawable-hdpi/img_making_loading.png b/app/src/main/res/drawable-hdpi/img_making_loading.png deleted file mode 100755 index b12c1ba..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_making_loading.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_menu_sample_a_01.png b/app/src/main/res/drawable-hdpi/img_menu_sample_a_01.png new file mode 100644 index 0000000..526d716 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_menu_sample_a_01.png differ diff --git a/app/src/main/res/drawable-hdpi/img_menu_sample_a_default.png b/app/src/main/res/drawable-hdpi/img_menu_sample_a_default.png new file mode 100755 index 0000000..246c7dc Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_menu_sample_a_default.png differ diff --git a/app/src/main/res/drawable-hdpi/img_menu_sample_b_default.png b/app/src/main/res/drawable-hdpi/img_menu_sample_b_default.png new file mode 100755 index 0000000..48407ff Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_menu_sample_b_default.png differ diff --git a/app/src/main/res/drawable-hdpi/img_menu_sample_c_default.png b/app/src/main/res/drawable-hdpi/img_menu_sample_c_default.png new file mode 100755 index 0000000..93cecd5 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_menu_sample_c_default.png differ diff --git a/app/src/main/res/drawable-hdpi/img_non_cart.png b/app/src/main/res/drawable-hdpi/img_non_cart.png new file mode 100755 index 0000000..9a4a88a Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_non_cart.png differ diff --git a/app/src/main/res/drawable-hdpi/img_non_history.png b/app/src/main/res/drawable-hdpi/img_non_history.png new file mode 100644 index 0000000..6886981 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_non_history.png differ diff --git a/app/src/main/res/drawable-hdpi/img_non_recent_order.png b/app/src/main/res/drawable-hdpi/img_non_recent_order.png new file mode 100644 index 0000000..40afacd Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_non_recent_order.png differ diff --git a/app/src/main/res/drawable-hdpi/img_notice_loogo_mini.png b/app/src/main/res/drawable-hdpi/img_notice_loogo_mini.png new file mode 100755 index 0000000..e1daec0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_notice_loogo_mini.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_cantorder.png b/app/src/main/res/drawable-hdpi/img_popup_cantorder.png new file mode 100755 index 0000000..e4a2691 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_cantorder.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_complete_menu.png b/app/src/main/res/drawable-hdpi/img_popup_complete_menu.png new file mode 100644 index 0000000..99346da Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_complete_menu.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_exit.png b/app/src/main/res/drawable-hdpi/img_popup_exit.png new file mode 100755 index 0000000..93364bb Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_exit.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_payment_complete.png b/app/src/main/res/drawable-hdpi/img_popup_payment_complete.png new file mode 100644 index 0000000..b5a29c9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_payment_complete.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_payment_confirm.png b/app/src/main/res/drawable-hdpi/img_popup_payment_confirm.png new file mode 100644 index 0000000..d082520 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_payment_confirm.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_payment_error.png b/app/src/main/res/drawable-hdpi/img_popup_payment_error.png new file mode 100755 index 0000000..90e1ece Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_payment_error.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_sold_out.png b/app/src/main/res/drawable-hdpi/img_popup_sold_out.png new file mode 100755 index 0000000..c381bfd Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_sold_out.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_store.png b/app/src/main/res/drawable-hdpi/img_popup_store.png new file mode 100644 index 0000000..575225f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_store.png differ diff --git a/app/src/main/res/drawable-hdpi/img_popup_store_failed.png b/app/src/main/res/drawable-hdpi/img_popup_store_failed.png new file mode 100755 index 0000000..888d090 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_popup_store_failed.png differ diff --git a/app/src/main/res/drawable-hdpi/img_process_01_payment_finish.png b/app/src/main/res/drawable-hdpi/img_process_01_payment_finish.png deleted file mode 100755 index 265e19c..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_process_01_payment_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_process_02_receive_finish.png b/app/src/main/res/drawable-hdpi/img_process_02_receive_finish.png deleted file mode 100755 index 94b0c56..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_process_02_receive_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_process_03_making_01_sel.png b/app/src/main/res/drawable-hdpi/img_process_03_making_01_sel.png deleted file mode 100755 index cb9cfd3..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_process_03_making_01_sel.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_process_04_complete_yet.png b/app/src/main/res/drawable-hdpi/img_process_04_complete_yet.png deleted file mode 100755 index 6ceb7d7..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_process_04_complete_yet.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_process_dotline.png b/app/src/main/res/drawable-hdpi/img_process_dotline.png deleted file mode 100755 index 38ebdaf..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_process_dotline.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_process_finish.png b/app/src/main/res/drawable-hdpi/img_process_finish.png new file mode 100644 index 0000000..f0818d7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_process_finish.png differ diff --git a/app/src/main/res/drawable-hdpi/img_process_ing.png b/app/src/main/res/drawable-hdpi/img_process_ing.png new file mode 100644 index 0000000..39c143d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_process_ing.png differ diff --git a/app/src/main/res/drawable-hdpi/img_process_yet.png b/app/src/main/res/drawable-hdpi/img_process_yet.png new file mode 100644 index 0000000..ad3fb5d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_process_yet.png differ diff --git a/app/src/main/res/drawable-hdpi/img_slidemenu_promotion.png b/app/src/main/res/drawable-hdpi/img_slidemenu_promotion.png deleted file mode 100755 index 81f2d58..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_slidemenu_promotion.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_state_line_dot.png b/app/src/main/res/drawable-hdpi/img_state_line_dot.png new file mode 100755 index 0000000..2422179 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_state_line_dot.png differ diff --git a/app/src/main/res/drawable-hdpi/img_store_default.png b/app/src/main/res/drawable-hdpi/img_store_default.png deleted file mode 100755 index 02b03ca..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_store_default.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_store_default_02.png b/app/src/main/res/drawable-hdpi/img_store_default_02.png deleted file mode 100755 index 1383df4..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_store_default_02.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_store_suggest.png b/app/src/main/res/drawable-hdpi/img_store_suggest.png deleted file mode 100755 index 9897802..0000000 Binary files a/app/src/main/res/drawable-hdpi/img_store_suggest.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/img_storelogo_default.png b/app/src/main/res/drawable-hdpi/img_storelogo_default.png new file mode 100755 index 0000000..3293051 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_storelogo_default.png differ diff --git a/app/src/main/res/drawable-hdpi/img_storelogo_sample_03.png b/app/src/main/res/drawable-hdpi/img_storelogo_sample_03.png new file mode 100644 index 0000000..e7f6feb Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_storelogo_sample_03.png differ diff --git a/app/src/main/res/drawable-mdpi/bg_num_round_01.png b/app/src/main/res/drawable-mdpi/bg_num_round_01.png new file mode 100644 index 0000000..f43fc04 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/bg_num_round_01.png differ diff --git a/app/src/main/res/drawable-mdpi/bg_roundbox_gray.9.png b/app/src/main/res/drawable-mdpi/bg_roundbox_gray.9.png deleted file mode 100755 index 80c6baf..0000000 Binary files a/app/src/main/res/drawable-mdpi/bg_roundbox_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/bg_roundbox_half_gray.9.png b/app/src/main/res/drawable-mdpi/bg_roundbox_half_gray.9.png deleted file mode 100755 index d9a8d62..0000000 Binary files a/app/src/main/res/drawable-mdpi/bg_roundbox_half_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/bg_roundbox_noline_white.9.png b/app/src/main/res/drawable-mdpi/bg_roundbox_noline_white.9.png deleted file mode 100755 index 7f6d80d..0000000 Binary files a/app/src/main/res/drawable-mdpi/bg_roundbox_noline_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/bg_roundbox_white.9.png b/app/src/main/res/drawable-mdpi/bg_roundbox_white.9.png deleted file mode 100755 index eb39a05..0000000 Binary files a/app/src/main/res/drawable-mdpi/bg_roundbox_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/bg_shadow_map.9.png b/app/src/main/res/drawable-mdpi/bg_shadow_map.9.png deleted file mode 100755 index eacbf4f..0000000 Binary files a/app/src/main/res/drawable-mdpi/bg_shadow_map.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_arrow_01_nor.png b/app/src/main/res/drawable-mdpi/btn_arrow_01_nor.png deleted file mode 100755 index bac2a06..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_arrow_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_arrow_down_nor.png b/app/src/main/res/drawable-mdpi/btn_arrow_down_nor.png new file mode 100755 index 0000000..47715c3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_arrow_down_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_arrow_up_nor.png b/app/src/main/res/drawable-mdpi/btn_arrow_up_nor.png new file mode 100755 index 0000000..9291944 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_arrow_up_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_check_01_nor.png b/app/src/main/res/drawable-mdpi/btn_check_01_nor.png new file mode 100755 index 0000000..216929d Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_check_01_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_check_01_sel.png b/app/src/main/res/drawable-mdpi/btn_check_01_sel.png new file mode 100755 index 0000000..1841a80 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_check_01_sel.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_alarm_nor.png b/app/src/main/res/drawable-mdpi/btn_main_alarm_nor.png deleted file mode 100755 index 99dbf06..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_main_alarm_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_m_o_nor.9.png b/app/src/main/res/drawable-mdpi/btn_main_m_o_nor.9.png deleted file mode 100755 index 0ac5a5d..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_main_m_o_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_m_o_pre.9.png b/app/src/main/res/drawable-mdpi/btn_main_m_o_pre.9.png deleted file mode 100755 index 923e363..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_main_m_o_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_menu_nor.png b/app/src/main/res/drawable-mdpi/btn_main_menu_nor.png old mode 100755 new mode 100644 index 18cf89c..8d8a520 Binary files a/app/src/main/res/drawable-mdpi/btn_main_menu_nor.png and b/app/src/main/res/drawable-mdpi/btn_main_menu_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_menu_pre.png b/app/src/main/res/drawable-mdpi/btn_main_menu_pre.png new file mode 100755 index 0000000..f72126d Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_main_menu_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_storechange_nor.png b/app/src/main/res/drawable-mdpi/btn_main_storechange_nor.png new file mode 100644 index 0000000..906926b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_main_storechange_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_main_storechange_pre.png b/app/src/main/res/drawable-mdpi/btn_main_storechange_pre.png new file mode 100644 index 0000000..d0435c0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_main_storechange_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_cart_nor.png b/app/src/main/res/drawable-mdpi/btn_menu_cart_nor.png old mode 100755 new mode 100644 index 8a77dd1..ee1a9b5 Binary files a/app/src/main/res/drawable-mdpi/btn_menu_cart_nor.png and b/app/src/main/res/drawable-mdpi/btn_menu_cart_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_cart_pre.png b/app/src/main/res/drawable-mdpi/btn_menu_cart_pre.png new file mode 100644 index 0000000..34e1dec Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_menu_cart_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_close_nor.png b/app/src/main/res/drawable-mdpi/btn_menu_close_nor.png old mode 100755 new mode 100644 diff --git a/app/src/main/res/drawable-mdpi/btn_menu_close_pre.png b/app/src/main/res/drawable-mdpi/btn_menu_close_pre.png new file mode 100644 index 0000000..d05184b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_menu_close_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_map_nor.png b/app/src/main/res/drawable-mdpi/btn_menu_map_nor.png deleted file mode 100755 index ec145bb..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_menu_map_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_sample_02_big.png b/app/src/main/res/drawable-mdpi/btn_menu_sample_02_big.png deleted file mode 100755 index cde1fde..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_menu_sample_02_big.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_menu_search_nor.png b/app/src/main/res/drawable-mdpi/btn_menu_search_nor.png deleted file mode 100755 index 254a9b9..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_menu_search_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_num_minus_nor.png b/app/src/main/res/drawable-mdpi/btn_num_minus_nor.png index c7b6c95..dee2230 100755 Binary files a/app/src/main/res/drawable-mdpi/btn_num_minus_nor.png and b/app/src/main/res/drawable-mdpi/btn_num_minus_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_num_minus_pre.png b/app/src/main/res/drawable-mdpi/btn_num_minus_pre.png new file mode 100755 index 0000000..f069d46 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_num_minus_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_num_plus_nor.png b/app/src/main/res/drawable-mdpi/btn_num_plus_nor.png index a90e5a8..fe07931 100755 Binary files a/app/src/main/res/drawable-mdpi/btn_num_plus_nor.png and b/app/src/main/res/drawable-mdpi/btn_num_plus_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_num_plus_pre.png b/app/src/main/res/drawable-mdpi/btn_num_plus_pre.png new file mode 100755 index 0000000..6b622fd Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_num_plus_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_otherview_pre.png b/app/src/main/res/drawable-mdpi/btn_otherview_pre.png deleted file mode 100755 index f9055b2..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_otherview_pre.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_popup_left_nor.9.png b/app/src/main/res/drawable-mdpi/btn_popup_left_nor.9.png deleted file mode 100755 index 9851cc9..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_popup_left_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_popup_left_pre.9.png b/app/src/main/res/drawable-mdpi/btn_popup_left_pre.9.png deleted file mode 100755 index e9ea264..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_popup_left_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_popup_right_nor.9.png b/app/src/main/res/drawable-mdpi/btn_popup_right_nor.9.png deleted file mode 100755 index 4cbe276..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_popup_right_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_popup_right_pre.9.png b/app/src/main/res/drawable-mdpi/btn_popup_right_pre.9.png deleted file mode 100755 index 20d12ad..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_popup_right_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_radio_01_nor.png b/app/src/main/res/drawable-mdpi/btn_radio_01_nor.png new file mode 100755 index 0000000..efbcfe1 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_radio_01_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_radio_01_sel.png b/app/src/main/res/drawable-mdpi/btn_radio_01_sel.png index be0e86f..8748046 100755 Binary files a/app/src/main/res/drawable-mdpi/btn_radio_01_sel.png and b/app/src/main/res/drawable-mdpi/btn_radio_01_sel.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_radio_01_unsel.png b/app/src/main/res/drawable-mdpi/btn_radio_01_unsel.png deleted file mode 100755 index b7f7655..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_radio_01_unsel.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_re_cart_nor.png b/app/src/main/res/drawable-mdpi/btn_re_cart_nor.png new file mode 100644 index 0000000..812eea5 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_re_cart_nor.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_re_cart_pre.png b/app/src/main/res/drawable-mdpi/btn_re_cart_pre.png new file mode 100644 index 0000000..c2b56e0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/btn_re_cart_pre.png differ diff --git a/app/src/main/res/drawable-mdpi/btn_recent_menu_sample_01_nor.png b/app/src/main/res/drawable-mdpi/btn_recent_menu_sample_01_nor.png deleted file mode 100755 index 7193f8f..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_recent_menu_sample_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_storechange_01_nor.9.png b/app/src/main/res/drawable-mdpi/btn_storechange_01_nor.9.png deleted file mode 100755 index c44d67f..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_storechange_01_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_storechange_nor.9.png b/app/src/main/res/drawable-mdpi/btn_storechange_nor.9.png deleted file mode 100755 index ce7128d..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_storechange_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/btn_storechange_pre.9.png b/app/src/main/res/drawable-mdpi/btn_storechange_pre.9.png deleted file mode 100755 index 63ac3e6..0000000 Binary files a/app/src/main/res/drawable-mdpi/btn_storechange_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_arrow_enter.png b/app/src/main/res/drawable-mdpi/img_arrow_enter.png new file mode 100644 index 0000000..1dfe07b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_arrow_enter.png differ diff --git a/app/src/main/res/drawable-mdpi/img_arrow_mo_guide.png b/app/src/main/res/drawable-mdpi/img_arrow_mo_guide.png new file mode 100755 index 0000000..13118fa Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_arrow_mo_guide.png differ diff --git a/app/src/main/res/drawable-mdpi/img_brand_logo.png b/app/src/main/res/drawable-mdpi/img_brand_logo.png new file mode 100755 index 0000000..ebdcc5c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_brand_logo.png differ diff --git a/app/src/main/res/drawable-mdpi/img_category_underline.9.png b/app/src/main/res/drawable-mdpi/img_category_underline.9.png deleted file mode 100755 index e504703..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_category_underline.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_contactus_call.png b/app/src/main/res/drawable-mdpi/img_contactus_call.png new file mode 100644 index 0000000..25fd76b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_contactus_call.png differ diff --git a/app/src/main/res/drawable-mdpi/img_main_point.png b/app/src/main/res/drawable-mdpi/img_main_point.png new file mode 100644 index 0000000..c6b6ad3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_main_point.png differ diff --git a/app/src/main/res/drawable-mdpi/img_making_loading.png b/app/src/main/res/drawable-mdpi/img_making_loading.png deleted file mode 100755 index 3708b7a..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_making_loading.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_menu_sample_a_01.png b/app/src/main/res/drawable-mdpi/img_menu_sample_a_01.png new file mode 100644 index 0000000..1073328 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_menu_sample_a_01.png differ diff --git a/app/src/main/res/drawable-mdpi/img_menu_sample_a_default.png b/app/src/main/res/drawable-mdpi/img_menu_sample_a_default.png new file mode 100755 index 0000000..9bf0b77 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_menu_sample_a_default.png differ diff --git a/app/src/main/res/drawable-mdpi/img_menu_sample_b_default.png b/app/src/main/res/drawable-mdpi/img_menu_sample_b_default.png new file mode 100755 index 0000000..7f122a7 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_menu_sample_b_default.png differ diff --git a/app/src/main/res/drawable-mdpi/img_menu_sample_c_default.png b/app/src/main/res/drawable-mdpi/img_menu_sample_c_default.png new file mode 100755 index 0000000..0fca7c5 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_menu_sample_c_default.png differ diff --git a/app/src/main/res/drawable-mdpi/img_non_cart.png b/app/src/main/res/drawable-mdpi/img_non_cart.png new file mode 100755 index 0000000..80e9062 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_non_cart.png differ diff --git a/app/src/main/res/drawable-mdpi/img_non_history.png b/app/src/main/res/drawable-mdpi/img_non_history.png new file mode 100644 index 0000000..c0ea613 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_non_history.png differ diff --git a/app/src/main/res/drawable-mdpi/img_non_recent_order.png b/app/src/main/res/drawable-mdpi/img_non_recent_order.png new file mode 100644 index 0000000..1265aad Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_non_recent_order.png differ diff --git a/app/src/main/res/drawable-mdpi/img_notice_loogo_mini.png b/app/src/main/res/drawable-mdpi/img_notice_loogo_mini.png new file mode 100755 index 0000000..828545b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_notice_loogo_mini.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_cantorder.png b/app/src/main/res/drawable-mdpi/img_popup_cantorder.png new file mode 100755 index 0000000..a9a8ab4 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_cantorder.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_complete_menu.png b/app/src/main/res/drawable-mdpi/img_popup_complete_menu.png new file mode 100644 index 0000000..e47ea37 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_complete_menu.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_exit.png b/app/src/main/res/drawable-mdpi/img_popup_exit.png new file mode 100755 index 0000000..656593d Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_exit.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_payment_complete.png b/app/src/main/res/drawable-mdpi/img_popup_payment_complete.png new file mode 100644 index 0000000..e630d4c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_payment_complete.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_payment_confirm.png b/app/src/main/res/drawable-mdpi/img_popup_payment_confirm.png new file mode 100644 index 0000000..11f8f92 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_payment_confirm.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_payment_error.png b/app/src/main/res/drawable-mdpi/img_popup_payment_error.png new file mode 100755 index 0000000..49a0061 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_payment_error.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_sold_out.png b/app/src/main/res/drawable-mdpi/img_popup_sold_out.png new file mode 100755 index 0000000..0a491ad Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_sold_out.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_store.png b/app/src/main/res/drawable-mdpi/img_popup_store.png new file mode 100644 index 0000000..c606c89 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_store.png differ diff --git a/app/src/main/res/drawable-mdpi/img_popup_store_failed.png b/app/src/main/res/drawable-mdpi/img_popup_store_failed.png new file mode 100755 index 0000000..d87e710 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_popup_store_failed.png differ diff --git a/app/src/main/res/drawable-mdpi/img_process_01_payment_finish.png b/app/src/main/res/drawable-mdpi/img_process_01_payment_finish.png deleted file mode 100755 index 4117ca6..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_process_01_payment_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_process_02_receive_finish.png b/app/src/main/res/drawable-mdpi/img_process_02_receive_finish.png deleted file mode 100755 index 3575922..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_process_02_receive_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_process_03_making_01_sel.png b/app/src/main/res/drawable-mdpi/img_process_03_making_01_sel.png deleted file mode 100755 index b551fc7..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_process_03_making_01_sel.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_process_04_complete_yet.png b/app/src/main/res/drawable-mdpi/img_process_04_complete_yet.png deleted file mode 100755 index a8f492c..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_process_04_complete_yet.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_process_dotline.png b/app/src/main/res/drawable-mdpi/img_process_dotline.png deleted file mode 100755 index 7a49cdc..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_process_dotline.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_process_finish.png b/app/src/main/res/drawable-mdpi/img_process_finish.png new file mode 100644 index 0000000..623965a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_process_finish.png differ diff --git a/app/src/main/res/drawable-mdpi/img_process_ing.png b/app/src/main/res/drawable-mdpi/img_process_ing.png new file mode 100644 index 0000000..030cc79 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_process_ing.png differ diff --git a/app/src/main/res/drawable-mdpi/img_process_yet.png b/app/src/main/res/drawable-mdpi/img_process_yet.png new file mode 100644 index 0000000..855954b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_process_yet.png differ diff --git a/app/src/main/res/drawable-mdpi/img_slidemenu_promotion.png b/app/src/main/res/drawable-mdpi/img_slidemenu_promotion.png deleted file mode 100755 index d0bd8a7..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_slidemenu_promotion.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_state_line_dot.png b/app/src/main/res/drawable-mdpi/img_state_line_dot.png new file mode 100755 index 0000000..55a3500 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_state_line_dot.png differ diff --git a/app/src/main/res/drawable-mdpi/img_store_default.png b/app/src/main/res/drawable-mdpi/img_store_default.png deleted file mode 100755 index f61c2e1..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_store_default.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_store_default_02.png b/app/src/main/res/drawable-mdpi/img_store_default_02.png deleted file mode 100755 index 401bc52..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_store_default_02.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_store_suggest.png b/app/src/main/res/drawable-mdpi/img_store_suggest.png deleted file mode 100755 index f45d86c..0000000 Binary files a/app/src/main/res/drawable-mdpi/img_store_suggest.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/img_storelogo_default.png b/app/src/main/res/drawable-mdpi/img_storelogo_default.png new file mode 100755 index 0000000..033bccd Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_storelogo_default.png differ diff --git a/app/src/main/res/drawable-mdpi/img_storelogo_sample_03.png b/app/src/main/res/drawable-mdpi/img_storelogo_sample_03.png new file mode 100644 index 0000000..c7712e2 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/img_storelogo_sample_03.png differ diff --git a/app/src/main/res/drawable-xhdpi/bg_num_round_01.png b/app/src/main/res/drawable-xhdpi/bg_num_round_01.png new file mode 100644 index 0000000..20f6c0a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/bg_num_round_01.png differ diff --git a/app/src/main/res/drawable-xhdpi/bg_roundbox_gray.9.png b/app/src/main/res/drawable-xhdpi/bg_roundbox_gray.9.png deleted file mode 100755 index 09f50ee..0000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_roundbox_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_roundbox_half_gray.9.png b/app/src/main/res/drawable-xhdpi/bg_roundbox_half_gray.9.png deleted file mode 100755 index e5b0c94..0000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_roundbox_half_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_roundbox_noline_white.9.png b/app/src/main/res/drawable-xhdpi/bg_roundbox_noline_white.9.png deleted file mode 100755 index 4c9b95c..0000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_roundbox_noline_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_roundbox_white.9.png b/app/src/main/res/drawable-xhdpi/bg_roundbox_white.9.png deleted file mode 100755 index 3af0420..0000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_roundbox_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/bg_shadow_map.9.png b/app/src/main/res/drawable-xhdpi/bg_shadow_map.9.png deleted file mode 100755 index 73e7adf..0000000 Binary files a/app/src/main/res/drawable-xhdpi/bg_shadow_map.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_arrow_01_nor.png b/app/src/main/res/drawable-xhdpi/btn_arrow_01_nor.png deleted file mode 100755 index 612a48c..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_arrow_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_arrow_down_nor.png b/app/src/main/res/drawable-xhdpi/btn_arrow_down_nor.png new file mode 100755 index 0000000..88bc5d4 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_arrow_down_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_arrow_up_nor.png b/app/src/main/res/drawable-xhdpi/btn_arrow_up_nor.png new file mode 100755 index 0000000..2bb1204 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_arrow_up_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_check_01_nor.png b/app/src/main/res/drawable-xhdpi/btn_check_01_nor.png new file mode 100755 index 0000000..cb8cb6c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_check_01_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_check_01_sel.png b/app/src/main/res/drawable-xhdpi/btn_check_01_sel.png new file mode 100755 index 0000000..f33d9e7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_check_01_sel.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_alarm_nor.png b/app/src/main/res/drawable-xhdpi/btn_main_alarm_nor.png deleted file mode 100755 index 62ca866..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_main_alarm_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_m_o_nor.9.png b/app/src/main/res/drawable-xhdpi/btn_main_m_o_nor.9.png deleted file mode 100755 index 8711abc..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_main_m_o_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_m_o_pre.9.png b/app/src/main/res/drawable-xhdpi/btn_main_m_o_pre.9.png deleted file mode 100755 index a1c4e5c..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_main_m_o_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_menu_nor.png b/app/src/main/res/drawable-xhdpi/btn_main_menu_nor.png old mode 100755 new mode 100644 index 7ba3a9e..03fa481 Binary files a/app/src/main/res/drawable-xhdpi/btn_main_menu_nor.png and b/app/src/main/res/drawable-xhdpi/btn_main_menu_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_menu_pre.png b/app/src/main/res/drawable-xhdpi/btn_main_menu_pre.png new file mode 100755 index 0000000..f4c9b55 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_main_menu_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_storechange_nor.png b/app/src/main/res/drawable-xhdpi/btn_main_storechange_nor.png new file mode 100644 index 0000000..af27e34 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_main_storechange_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_main_storechange_pre.png b/app/src/main/res/drawable-xhdpi/btn_main_storechange_pre.png new file mode 100644 index 0000000..b788f50 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_main_storechange_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_cart_nor.png b/app/src/main/res/drawable-xhdpi/btn_menu_cart_nor.png old mode 100755 new mode 100644 index b99df98..1f67610 Binary files a/app/src/main/res/drawable-xhdpi/btn_menu_cart_nor.png and b/app/src/main/res/drawable-xhdpi/btn_menu_cart_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_cart_pre.png b/app/src/main/res/drawable-xhdpi/btn_menu_cart_pre.png new file mode 100644 index 0000000..715c454 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_menu_cart_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_close_nor.png b/app/src/main/res/drawable-xhdpi/btn_menu_close_nor.png old mode 100755 new mode 100644 diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_close_pre.png b/app/src/main/res/drawable-xhdpi/btn_menu_close_pre.png new file mode 100644 index 0000000..25cf2cd Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_menu_close_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_map_nor.png b/app/src/main/res/drawable-xhdpi/btn_menu_map_nor.png deleted file mode 100755 index d27c531..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_menu_map_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_sample_02_big.png b/app/src/main/res/drawable-xhdpi/btn_menu_sample_02_big.png deleted file mode 100755 index 57db149..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_menu_sample_02_big.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_menu_search_nor.png b/app/src/main/res/drawable-xhdpi/btn_menu_search_nor.png deleted file mode 100755 index 73fdd85..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_menu_search_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_num_minus_nor.png b/app/src/main/res/drawable-xhdpi/btn_num_minus_nor.png index 5c99470..caa689a 100755 Binary files a/app/src/main/res/drawable-xhdpi/btn_num_minus_nor.png and b/app/src/main/res/drawable-xhdpi/btn_num_minus_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_num_minus_pre.png b/app/src/main/res/drawable-xhdpi/btn_num_minus_pre.png new file mode 100755 index 0000000..63de150 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_num_minus_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_num_plus_nor.png b/app/src/main/res/drawable-xhdpi/btn_num_plus_nor.png index f19a6c6..4afaa24 100755 Binary files a/app/src/main/res/drawable-xhdpi/btn_num_plus_nor.png and b/app/src/main/res/drawable-xhdpi/btn_num_plus_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_num_plus_pre.png b/app/src/main/res/drawable-xhdpi/btn_num_plus_pre.png new file mode 100755 index 0000000..5388b0c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_num_plus_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_otherview_pre.png b/app/src/main/res/drawable-xhdpi/btn_otherview_pre.png deleted file mode 100755 index b3be6ce..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_otherview_pre.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_popup_left_nor.9.png b/app/src/main/res/drawable-xhdpi/btn_popup_left_nor.9.png deleted file mode 100755 index dca44aa..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_popup_left_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_popup_left_pre.9.png b/app/src/main/res/drawable-xhdpi/btn_popup_left_pre.9.png deleted file mode 100755 index 34d0078..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_popup_left_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_popup_right_nor.9.png b/app/src/main/res/drawable-xhdpi/btn_popup_right_nor.9.png deleted file mode 100755 index e5e57ee..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_popup_right_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_popup_right_pre.9.png b/app/src/main/res/drawable-xhdpi/btn_popup_right_pre.9.png deleted file mode 100755 index 6323ee4..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_popup_right_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_radio_01_nor.png b/app/src/main/res/drawable-xhdpi/btn_radio_01_nor.png new file mode 100755 index 0000000..b3ce9cc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_radio_01_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_radio_01_sel.png b/app/src/main/res/drawable-xhdpi/btn_radio_01_sel.png index 0c7f81b..eaad2ea 100755 Binary files a/app/src/main/res/drawable-xhdpi/btn_radio_01_sel.png and b/app/src/main/res/drawable-xhdpi/btn_radio_01_sel.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_radio_01_unsel.png b/app/src/main/res/drawable-xhdpi/btn_radio_01_unsel.png deleted file mode 100755 index 953683e..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_radio_01_unsel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_re_cart_nor.png b/app/src/main/res/drawable-xhdpi/btn_re_cart_nor.png new file mode 100644 index 0000000..938c581 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_re_cart_nor.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_re_cart_pre.png b/app/src/main/res/drawable-xhdpi/btn_re_cart_pre.png new file mode 100644 index 0000000..5219409 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/btn_re_cart_pre.png differ diff --git a/app/src/main/res/drawable-xhdpi/btn_recent_menu_sample_01_nor.png b/app/src/main/res/drawable-xhdpi/btn_recent_menu_sample_01_nor.png deleted file mode 100755 index 8dbc38c..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_recent_menu_sample_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_storechange_01_nor.9.png b/app/src/main/res/drawable-xhdpi/btn_storechange_01_nor.9.png deleted file mode 100755 index 53739c2..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_storechange_01_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_storechange_nor.9.png b/app/src/main/res/drawable-xhdpi/btn_storechange_nor.9.png deleted file mode 100755 index 7798087..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_storechange_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/btn_storechange_pre.9.png b/app/src/main/res/drawable-xhdpi/btn_storechange_pre.9.png deleted file mode 100755 index 3ca309a..0000000 Binary files a/app/src/main/res/drawable-xhdpi/btn_storechange_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_arrow_enter.png b/app/src/main/res/drawable-xhdpi/img_arrow_enter.png new file mode 100644 index 0000000..8c94f13 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_arrow_enter.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_arrow_mo_guide.png b/app/src/main/res/drawable-xhdpi/img_arrow_mo_guide.png new file mode 100755 index 0000000..889edac Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_arrow_mo_guide.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_brand_logo.png b/app/src/main/res/drawable-xhdpi/img_brand_logo.png new file mode 100755 index 0000000..46e0ddc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_brand_logo.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_category_underline.9.png b/app/src/main/res/drawable-xhdpi/img_category_underline.9.png deleted file mode 100755 index 7bf7e30..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_category_underline.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_contactus_call.png b/app/src/main/res/drawable-xhdpi/img_contactus_call.png new file mode 100644 index 0000000..394b9bf Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_contactus_call.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_main_point.png b/app/src/main/res/drawable-xhdpi/img_main_point.png new file mode 100644 index 0000000..4377302 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_main_point.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_making_loading.png b/app/src/main/res/drawable-xhdpi/img_making_loading.png deleted file mode 100755 index c2d01c4..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_making_loading.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_menu_sample_a_01.png b/app/src/main/res/drawable-xhdpi/img_menu_sample_a_01.png new file mode 100644 index 0000000..ae6d049 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_menu_sample_a_01.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_menu_sample_a_default.png b/app/src/main/res/drawable-xhdpi/img_menu_sample_a_default.png new file mode 100755 index 0000000..1a67d73 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_menu_sample_a_default.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_menu_sample_b_default.png b/app/src/main/res/drawable-xhdpi/img_menu_sample_b_default.png new file mode 100755 index 0000000..0df6731 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_menu_sample_b_default.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_menu_sample_c_default.png b/app/src/main/res/drawable-xhdpi/img_menu_sample_c_default.png new file mode 100755 index 0000000..5564508 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_menu_sample_c_default.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_non_cart.png b/app/src/main/res/drawable-xhdpi/img_non_cart.png new file mode 100755 index 0000000..478e555 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_non_cart.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_non_history.png b/app/src/main/res/drawable-xhdpi/img_non_history.png new file mode 100644 index 0000000..4399f96 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_non_history.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_non_recent_order.png b/app/src/main/res/drawable-xhdpi/img_non_recent_order.png new file mode 100644 index 0000000..2681532 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_non_recent_order.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_notice_loogo_mini.png b/app/src/main/res/drawable-xhdpi/img_notice_loogo_mini.png new file mode 100755 index 0000000..a8685de Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_notice_loogo_mini.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_cantorder.png b/app/src/main/res/drawable-xhdpi/img_popup_cantorder.png new file mode 100755 index 0000000..cc4f7c3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_cantorder.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_complete_menu.png b/app/src/main/res/drawable-xhdpi/img_popup_complete_menu.png new file mode 100644 index 0000000..7a2775b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_complete_menu.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_exit.png b/app/src/main/res/drawable-xhdpi/img_popup_exit.png new file mode 100755 index 0000000..d637c2f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_exit.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_payment_complete.png b/app/src/main/res/drawable-xhdpi/img_popup_payment_complete.png new file mode 100644 index 0000000..a7e6f70 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_payment_complete.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_payment_confirm.png b/app/src/main/res/drawable-xhdpi/img_popup_payment_confirm.png new file mode 100644 index 0000000..f71c143 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_payment_confirm.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_payment_error.png b/app/src/main/res/drawable-xhdpi/img_popup_payment_error.png new file mode 100755 index 0000000..3113882 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_payment_error.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_sold_out.png b/app/src/main/res/drawable-xhdpi/img_popup_sold_out.png new file mode 100755 index 0000000..6f9197a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_sold_out.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_store.png b/app/src/main/res/drawable-xhdpi/img_popup_store.png new file mode 100644 index 0000000..106ece5 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_store.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_popup_store_failed.png b/app/src/main/res/drawable-xhdpi/img_popup_store_failed.png new file mode 100755 index 0000000..5266f50 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_popup_store_failed.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_01_payment_finish.png b/app/src/main/res/drawable-xhdpi/img_process_01_payment_finish.png deleted file mode 100755 index 38cd020..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_process_01_payment_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_02_receive_finish.png b/app/src/main/res/drawable-xhdpi/img_process_02_receive_finish.png deleted file mode 100755 index 769031b..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_process_02_receive_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_03_making_01_sel.png b/app/src/main/res/drawable-xhdpi/img_process_03_making_01_sel.png deleted file mode 100755 index 0870954..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_process_03_making_01_sel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_04_complete_yet.png b/app/src/main/res/drawable-xhdpi/img_process_04_complete_yet.png deleted file mode 100755 index 20dcd88..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_process_04_complete_yet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_dotline.png b/app/src/main/res/drawable-xhdpi/img_process_dotline.png deleted file mode 100755 index eeb75e3..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_process_dotline.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_finish.png b/app/src/main/res/drawable-xhdpi/img_process_finish.png new file mode 100644 index 0000000..9aab1c4 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_process_finish.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_ing.png b/app/src/main/res/drawable-xhdpi/img_process_ing.png new file mode 100644 index 0000000..5eebfbf Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_process_ing.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_process_yet.png b/app/src/main/res/drawable-xhdpi/img_process_yet.png new file mode 100644 index 0000000..4db12ed Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_process_yet.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_slidemenu_promotion.png b/app/src/main/res/drawable-xhdpi/img_slidemenu_promotion.png deleted file mode 100755 index 47eae48..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_slidemenu_promotion.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_state_line_dot.png b/app/src/main/res/drawable-xhdpi/img_state_line_dot.png new file mode 100755 index 0000000..cca6281 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_state_line_dot.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_store_default.png b/app/src/main/res/drawable-xhdpi/img_store_default.png deleted file mode 100755 index e03d030..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_store_default.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_store_default_02.png b/app/src/main/res/drawable-xhdpi/img_store_default_02.png deleted file mode 100755 index 4f45a17..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_store_default_02.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_store_suggest.png b/app/src/main/res/drawable-xhdpi/img_store_suggest.png deleted file mode 100755 index 429e2c0..0000000 Binary files a/app/src/main/res/drawable-xhdpi/img_store_suggest.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/img_storelogo_default.png b/app/src/main/res/drawable-xhdpi/img_storelogo_default.png new file mode 100755 index 0000000..89f777b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_storelogo_default.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_storelogo_sample_03.png b/app/src/main/res/drawable-xhdpi/img_storelogo_sample_03.png new file mode 100644 index 0000000..30c4d4e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_storelogo_sample_03.png differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_num_round_01.png b/app/src/main/res/drawable-xxhdpi/bg_num_round_01.png new file mode 100644 index 0000000..f84d7d9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/bg_num_round_01.png differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_roundbox_gray.9.png b/app/src/main/res/drawable-xxhdpi/bg_roundbox_gray.9.png deleted file mode 100755 index c4a91d6..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_roundbox_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_roundbox_half_gray.9.png b/app/src/main/res/drawable-xxhdpi/bg_roundbox_half_gray.9.png deleted file mode 100755 index b99d256..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_roundbox_half_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_roundbox_noline_white.9.png b/app/src/main/res/drawable-xxhdpi/bg_roundbox_noline_white.9.png deleted file mode 100755 index 8b54327..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_roundbox_noline_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_roundbox_white.9.png b/app/src/main/res/drawable-xxhdpi/bg_roundbox_white.9.png deleted file mode 100755 index 6588c20..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_roundbox_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/bg_shadow_map.9.png b/app/src/main/res/drawable-xxhdpi/bg_shadow_map.9.png deleted file mode 100755 index 48609ea..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/bg_shadow_map.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_arrow_01_nor.png b/app/src/main/res/drawable-xxhdpi/btn_arrow_01_nor.png deleted file mode 100755 index c73fcc1..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_arrow_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_arrow_down_nor.png b/app/src/main/res/drawable-xxhdpi/btn_arrow_down_nor.png new file mode 100755 index 0000000..8c04874 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_arrow_down_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_arrow_up_nor.png b/app/src/main/res/drawable-xxhdpi/btn_arrow_up_nor.png new file mode 100755 index 0000000..caa821f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_arrow_up_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_check_01_nor.png b/app/src/main/res/drawable-xxhdpi/btn_check_01_nor.png new file mode 100755 index 0000000..8e14cec Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_check_01_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_check_01_sel.png b/app/src/main/res/drawable-xxhdpi/btn_check_01_sel.png new file mode 100755 index 0000000..b2fc0bd Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_check_01_sel.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_alarm_nor.png b/app/src/main/res/drawable-xxhdpi/btn_main_alarm_nor.png deleted file mode 100755 index 48e0583..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_main_alarm_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_m_o_nor.9.png b/app/src/main/res/drawable-xxhdpi/btn_main_m_o_nor.9.png deleted file mode 100755 index d3fe2ee..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_main_m_o_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_m_o_pre.9.png b/app/src/main/res/drawable-xxhdpi/btn_main_m_o_pre.9.png deleted file mode 100755 index bb68752..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_main_m_o_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_menu_nor.png b/app/src/main/res/drawable-xxhdpi/btn_main_menu_nor.png old mode 100755 new mode 100644 index 0ed1501..21abd73 Binary files a/app/src/main/res/drawable-xxhdpi/btn_main_menu_nor.png and b/app/src/main/res/drawable-xxhdpi/btn_main_menu_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_menu_pre.png b/app/src/main/res/drawable-xxhdpi/btn_main_menu_pre.png new file mode 100755 index 0000000..c9e5756 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_main_menu_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_storechange_nor.png b/app/src/main/res/drawable-xxhdpi/btn_main_storechange_nor.png new file mode 100644 index 0000000..a78c36c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_main_storechange_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_main_storechange_pre.png b/app/src/main/res/drawable-xxhdpi/btn_main_storechange_pre.png new file mode 100644 index 0000000..b48a88b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_main_storechange_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_cart_nor.png b/app/src/main/res/drawable-xxhdpi/btn_menu_cart_nor.png old mode 100755 new mode 100644 index 7d30e6c..84a590a Binary files a/app/src/main/res/drawable-xxhdpi/btn_menu_cart_nor.png and b/app/src/main/res/drawable-xxhdpi/btn_menu_cart_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_cart_pre.png b/app/src/main/res/drawable-xxhdpi/btn_menu_cart_pre.png new file mode 100644 index 0000000..d02fdce Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_menu_cart_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_close_nor.png b/app/src/main/res/drawable-xxhdpi/btn_menu_close_nor.png old mode 100755 new mode 100644 diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_close_pre.png b/app/src/main/res/drawable-xxhdpi/btn_menu_close_pre.png new file mode 100644 index 0000000..2fe6498 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_menu_close_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_map_nor.png b/app/src/main/res/drawable-xxhdpi/btn_menu_map_nor.png deleted file mode 100755 index 27ce64d..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_menu_map_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_sample_02_big.png b/app/src/main/res/drawable-xxhdpi/btn_menu_sample_02_big.png deleted file mode 100755 index 8a3a7d1..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_menu_sample_02_big.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_menu_search_nor.png b/app/src/main/res/drawable-xxhdpi/btn_menu_search_nor.png deleted file mode 100755 index dea3711..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_menu_search_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_num_minus_nor.png b/app/src/main/res/drawable-xxhdpi/btn_num_minus_nor.png index 4b44e15..4bbc489 100755 Binary files a/app/src/main/res/drawable-xxhdpi/btn_num_minus_nor.png and b/app/src/main/res/drawable-xxhdpi/btn_num_minus_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_num_minus_pre.png b/app/src/main/res/drawable-xxhdpi/btn_num_minus_pre.png new file mode 100755 index 0000000..62e112f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_num_minus_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_num_plus_nor.png b/app/src/main/res/drawable-xxhdpi/btn_num_plus_nor.png index 3d56cac..4746bb5 100755 Binary files a/app/src/main/res/drawable-xxhdpi/btn_num_plus_nor.png and b/app/src/main/res/drawable-xxhdpi/btn_num_plus_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_num_plus_pre.png b/app/src/main/res/drawable-xxhdpi/btn_num_plus_pre.png new file mode 100755 index 0000000..e55962f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_num_plus_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_otherview_pre.png b/app/src/main/res/drawable-xxhdpi/btn_otherview_pre.png deleted file mode 100755 index 684a844..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_otherview_pre.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_popup_left_nor.9.png b/app/src/main/res/drawable-xxhdpi/btn_popup_left_nor.9.png deleted file mode 100755 index db82714..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_popup_left_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_popup_left_pre.9.png b/app/src/main/res/drawable-xxhdpi/btn_popup_left_pre.9.png deleted file mode 100755 index e10d723..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_popup_left_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_popup_right_nor.9.png b/app/src/main/res/drawable-xxhdpi/btn_popup_right_nor.9.png deleted file mode 100755 index 095d372..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_popup_right_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_popup_right_pre.9.png b/app/src/main/res/drawable-xxhdpi/btn_popup_right_pre.9.png deleted file mode 100755 index 50cb5d0..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_popup_right_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_radio_01_nor.png b/app/src/main/res/drawable-xxhdpi/btn_radio_01_nor.png new file mode 100755 index 0000000..9df359b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_radio_01_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_radio_01_sel.png b/app/src/main/res/drawable-xxhdpi/btn_radio_01_sel.png index a89e782..572c752 100755 Binary files a/app/src/main/res/drawable-xxhdpi/btn_radio_01_sel.png and b/app/src/main/res/drawable-xxhdpi/btn_radio_01_sel.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_radio_01_unsel.png b/app/src/main/res/drawable-xxhdpi/btn_radio_01_unsel.png deleted file mode 100755 index 4baa461..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_radio_01_unsel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_re_cart_nor.png b/app/src/main/res/drawable-xxhdpi/btn_re_cart_nor.png new file mode 100644 index 0000000..61814e1 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_re_cart_nor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_re_cart_pre.png b/app/src/main/res/drawable-xxhdpi/btn_re_cart_pre.png new file mode 100644 index 0000000..505cf0c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/btn_re_cart_pre.png differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_recent_menu_sample_01_nor.png b/app/src/main/res/drawable-xxhdpi/btn_recent_menu_sample_01_nor.png deleted file mode 100755 index 48137a6..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_recent_menu_sample_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_storechange_01_nor.9.png b/app/src/main/res/drawable-xxhdpi/btn_storechange_01_nor.9.png deleted file mode 100755 index e390291..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_storechange_01_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_storechange_nor.9.png b/app/src/main/res/drawable-xxhdpi/btn_storechange_nor.9.png deleted file mode 100755 index 89238cb..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_storechange_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/btn_storechange_pre.9.png b/app/src/main/res/drawable-xxhdpi/btn_storechange_pre.9.png deleted file mode 100755 index f3a79a8..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/btn_storechange_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_arrow_enter.png b/app/src/main/res/drawable-xxhdpi/img_arrow_enter.png new file mode 100644 index 0000000..9188e71 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_arrow_enter.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_arrow_mo_guide.png b/app/src/main/res/drawable-xxhdpi/img_arrow_mo_guide.png new file mode 100755 index 0000000..16f3bf7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_arrow_mo_guide.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_brand_logo.png b/app/src/main/res/drawable-xxhdpi/img_brand_logo.png new file mode 100755 index 0000000..75a8a2b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_brand_logo.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_category_underline.9.png b/app/src/main/res/drawable-xxhdpi/img_category_underline.9.png deleted file mode 100755 index f6fa8c2..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_category_underline.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_contactus_call.png b/app/src/main/res/drawable-xxhdpi/img_contactus_call.png new file mode 100644 index 0000000..80441e8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_contactus_call.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_main_point.png b/app/src/main/res/drawable-xxhdpi/img_main_point.png new file mode 100644 index 0000000..361c3a1 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_main_point.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_making_loading.png b/app/src/main/res/drawable-xxhdpi/img_making_loading.png deleted file mode 100755 index b8e7db5..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_making_loading.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_01.png b/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_01.png new file mode 100644 index 0000000..5ed9459 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_01.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_default.png b/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_default.png new file mode 100755 index 0000000..a58eda8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_menu_sample_a_default.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_menu_sample_b_default.png b/app/src/main/res/drawable-xxhdpi/img_menu_sample_b_default.png new file mode 100755 index 0000000..3727acc Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_menu_sample_b_default.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_menu_sample_c_default.png b/app/src/main/res/drawable-xxhdpi/img_menu_sample_c_default.png new file mode 100755 index 0000000..af54fc7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_menu_sample_c_default.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_non_cart.png b/app/src/main/res/drawable-xxhdpi/img_non_cart.png new file mode 100755 index 0000000..595a96a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_non_cart.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_non_history.png b/app/src/main/res/drawable-xxhdpi/img_non_history.png new file mode 100644 index 0000000..04590c8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_non_history.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_non_recent_order.png b/app/src/main/res/drawable-xxhdpi/img_non_recent_order.png new file mode 100644 index 0000000..1289bde Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_non_recent_order.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_notice_loogo_mini.png b/app/src/main/res/drawable-xxhdpi/img_notice_loogo_mini.png new file mode 100755 index 0000000..c3c1c1e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_notice_loogo_mini.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_cantorder.png b/app/src/main/res/drawable-xxhdpi/img_popup_cantorder.png new file mode 100755 index 0000000..fdf57fa Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_cantorder.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_complete_menu.png b/app/src/main/res/drawable-xxhdpi/img_popup_complete_menu.png new file mode 100644 index 0000000..0cb4035 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_complete_menu.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_exit.png b/app/src/main/res/drawable-xxhdpi/img_popup_exit.png new file mode 100755 index 0000000..d4393da Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_exit.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_payment_complete.png b/app/src/main/res/drawable-xxhdpi/img_popup_payment_complete.png new file mode 100644 index 0000000..a997ade Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_payment_complete.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_payment_confirm.png b/app/src/main/res/drawable-xxhdpi/img_popup_payment_confirm.png new file mode 100644 index 0000000..9404e41 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_payment_confirm.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_payment_error.png b/app/src/main/res/drawable-xxhdpi/img_popup_payment_error.png new file mode 100755 index 0000000..113d56e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_payment_error.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_sold_out.png b/app/src/main/res/drawable-xxhdpi/img_popup_sold_out.png new file mode 100755 index 0000000..af357b8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_sold_out.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_store.png b/app/src/main/res/drawable-xxhdpi/img_popup_store.png new file mode 100644 index 0000000..2e42636 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_store.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_popup_store_failed.png b/app/src/main/res/drawable-xxhdpi/img_popup_store_failed.png new file mode 100755 index 0000000..919cfb7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_popup_store_failed.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_01_payment_finish.png b/app/src/main/res/drawable-xxhdpi/img_process_01_payment_finish.png deleted file mode 100755 index 7c066d6..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_process_01_payment_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_02_receive_finish.png b/app/src/main/res/drawable-xxhdpi/img_process_02_receive_finish.png deleted file mode 100755 index 8deec01..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_process_02_receive_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_03_making_01_sel.png b/app/src/main/res/drawable-xxhdpi/img_process_03_making_01_sel.png deleted file mode 100755 index 6355f3d..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_process_03_making_01_sel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_04_complete_yet.png b/app/src/main/res/drawable-xxhdpi/img_process_04_complete_yet.png deleted file mode 100755 index b34163b..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_process_04_complete_yet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_dotline.png b/app/src/main/res/drawable-xxhdpi/img_process_dotline.png deleted file mode 100755 index 85f8bf5..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_process_dotline.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_finish.png b/app/src/main/res/drawable-xxhdpi/img_process_finish.png new file mode 100644 index 0000000..3641ad1 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_process_finish.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_ing.png b/app/src/main/res/drawable-xxhdpi/img_process_ing.png new file mode 100644 index 0000000..ec91d6d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_process_ing.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_process_yet.png b/app/src/main/res/drawable-xxhdpi/img_process_yet.png new file mode 100644 index 0000000..3317703 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_process_yet.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_slidemenu_promotion.png b/app/src/main/res/drawable-xxhdpi/img_slidemenu_promotion.png deleted file mode 100755 index 1247b50..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_slidemenu_promotion.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_state_line_dot.png b/app/src/main/res/drawable-xxhdpi/img_state_line_dot.png new file mode 100755 index 0000000..136251d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_state_line_dot.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_store_default.png b/app/src/main/res/drawable-xxhdpi/img_store_default.png deleted file mode 100755 index 2eb329c..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_store_default.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_store_default_02.png b/app/src/main/res/drawable-xxhdpi/img_store_default_02.png deleted file mode 100755 index d7a40d4..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_store_default_02.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_store_suggest.png b/app/src/main/res/drawable-xxhdpi/img_store_suggest.png deleted file mode 100755 index 9e5c6b0..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/img_store_suggest.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/img_storelogo_default.png b/app/src/main/res/drawable-xxhdpi/img_storelogo_default.png new file mode 100755 index 0000000..27127ae Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_storelogo_default.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_storelogo_sample_03.png b/app/src/main/res/drawable-xxhdpi/img_storelogo_sample_03.png new file mode 100644 index 0000000..377076f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_storelogo_sample_03.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_num_round_01.png b/app/src/main/res/drawable-xxxhdpi/bg_num_round_01.png new file mode 100644 index 0000000..c79cfda Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/bg_num_round_01.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_gray.9.png b/app/src/main/res/drawable-xxxhdpi/bg_roundbox_gray.9.png deleted file mode 100755 index c4a91d6..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_half_gray.9.png b/app/src/main/res/drawable-xxxhdpi/bg_roundbox_half_gray.9.png deleted file mode 100755 index b99d256..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_half_gray.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_noline_white.9.png b/app/src/main/res/drawable-xxxhdpi/bg_roundbox_noline_white.9.png deleted file mode 100755 index 8b54327..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_noline_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_white.9.png b/app/src/main/res/drawable-xxxhdpi/bg_roundbox_white.9.png deleted file mode 100755 index 6588c20..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_roundbox_white.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/bg_shadow_map.9.png b/app/src/main/res/drawable-xxxhdpi/bg_shadow_map.9.png deleted file mode 100755 index 8b158ab..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/bg_shadow_map.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_arrow_01_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_arrow_01_nor.png deleted file mode 100755 index 64742b5..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_arrow_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_arrow_down_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_arrow_down_nor.png new file mode 100755 index 0000000..40d68e5 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_arrow_down_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_arrow_up_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_arrow_up_nor.png new file mode 100755 index 0000000..5c54793 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_arrow_up_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_check_01_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_check_01_nor.png new file mode 100755 index 0000000..45adb2d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_check_01_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_check_01_sel.png b/app/src/main/res/drawable-xxxhdpi/btn_check_01_sel.png new file mode 100755 index 0000000..2751425 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_check_01_sel.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_alarm_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_main_alarm_nor.png deleted file mode 100755 index ebbb783..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_main_alarm_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_nor.9.png b/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_nor.9.png deleted file mode 100755 index d3fe2ee..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_pre.9.png b/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_pre.9.png deleted file mode 100755 index bb68752..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_main_m_o_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_menu_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_main_menu_nor.png old mode 100755 new mode 100644 index 824c262..b8108dd Binary files a/app/src/main/res/drawable-xxxhdpi/btn_main_menu_nor.png and b/app/src/main/res/drawable-xxxhdpi/btn_main_menu_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_menu_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_main_menu_pre.png new file mode 100755 index 0000000..ac6d40c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_main_menu_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_nor.png new file mode 100644 index 0000000..25dfb2b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_pre.png new file mode 100644 index 0000000..65e2ece Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_main_storechange_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_nor.png old mode 100755 new mode 100644 index 2d46685..7841c75 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_nor.png and b/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_pre.png new file mode 100644 index 0000000..fda0cf9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_menu_cart_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_close_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_close_nor.png old mode 100755 new mode 100644 diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_close_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_close_pre.png new file mode 100644 index 0000000..d684b94 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_menu_close_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_map_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_map_nor.png deleted file mode 100755 index 6fa7895..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_menu_map_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_sample_02_big.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_sample_02_big.png deleted file mode 100755 index 49a8c8c..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_menu_sample_02_big.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_menu_search_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_menu_search_nor.png deleted file mode 100755 index c045fc7..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_menu_search_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_num_minus_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_num_minus_nor.png index 41d74fb..dcbd4fe 100755 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_num_minus_nor.png and b/app/src/main/res/drawable-xxxhdpi/btn_num_minus_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_num_minus_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_num_minus_pre.png new file mode 100755 index 0000000..df96317 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_num_minus_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_num_plus_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_num_plus_nor.png index 4c511ac..25b8033 100755 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_num_plus_nor.png and b/app/src/main/res/drawable-xxxhdpi/btn_num_plus_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_num_plus_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_num_plus_pre.png new file mode 100755 index 0000000..352b5fb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_num_plus_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_otherview_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_otherview_pre.png deleted file mode 100755 index fe16aff..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_otherview_pre.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_popup_left_nor.9.png b/app/src/main/res/drawable-xxxhdpi/btn_popup_left_nor.9.png deleted file mode 100755 index 3dec5c2..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_popup_left_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_popup_left_pre.9.png b/app/src/main/res/drawable-xxxhdpi/btn_popup_left_pre.9.png deleted file mode 100755 index 439537d..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_popup_left_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_popup_right_nor.9.png b/app/src/main/res/drawable-xxxhdpi/btn_popup_right_nor.9.png deleted file mode 100755 index 1b9fbcf..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_popup_right_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_popup_right_pre.9.png b/app/src/main/res/drawable-xxxhdpi/btn_popup_right_pre.9.png deleted file mode 100755 index b845111..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_popup_right_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_radio_01_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_radio_01_nor.png new file mode 100755 index 0000000..0ba86bb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_radio_01_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_radio_01_sel.png b/app/src/main/res/drawable-xxxhdpi/btn_radio_01_sel.png index be48772..139f3b6 100755 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_radio_01_sel.png and b/app/src/main/res/drawable-xxxhdpi/btn_radio_01_sel.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_radio_01_unsel.png b/app/src/main/res/drawable-xxxhdpi/btn_radio_01_unsel.png deleted file mode 100755 index 935b53f..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_radio_01_unsel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_re_cart_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_re_cart_nor.png new file mode 100644 index 0000000..243fb54 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_re_cart_nor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_re_cart_pre.png b/app/src/main/res/drawable-xxxhdpi/btn_re_cart_pre.png new file mode 100644 index 0000000..c291f91 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/btn_re_cart_pre.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_recent_menu_sample_01_nor.png b/app/src/main/res/drawable-xxxhdpi/btn_recent_menu_sample_01_nor.png deleted file mode 100755 index 10c4bda..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_recent_menu_sample_01_nor.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_storechange_01_nor.9.png b/app/src/main/res/drawable-xxxhdpi/btn_storechange_01_nor.9.png deleted file mode 100755 index 5adc698..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_storechange_01_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_storechange_nor.9.png b/app/src/main/res/drawable-xxxhdpi/btn_storechange_nor.9.png deleted file mode 100755 index 80945d6..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_storechange_nor.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/btn_storechange_pre.9.png b/app/src/main/res/drawable-xxxhdpi/btn_storechange_pre.9.png deleted file mode 100755 index 71dd0f9..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/btn_storechange_pre.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_arrow_enter.png b/app/src/main/res/drawable-xxxhdpi/img_arrow_enter.png new file mode 100644 index 0000000..678013e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_arrow_enter.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_arrow_mo_guide.png b/app/src/main/res/drawable-xxxhdpi/img_arrow_mo_guide.png new file mode 100755 index 0000000..86c8dc3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_arrow_mo_guide.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_brand_logo.png b/app/src/main/res/drawable-xxxhdpi/img_brand_logo.png new file mode 100755 index 0000000..f818613 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_brand_logo.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_category_underline.9.png b/app/src/main/res/drawable-xxxhdpi/img_category_underline.9.png deleted file mode 100755 index 65a0bb7..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_category_underline.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_contactus_call.png b/app/src/main/res/drawable-xxxhdpi/img_contactus_call.png new file mode 100644 index 0000000..0a4bab8 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_contactus_call.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_main_point.png b/app/src/main/res/drawable-xxxhdpi/img_main_point.png new file mode 100644 index 0000000..41565ad Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_main_point.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_making_loading.png b/app/src/main/res/drawable-xxxhdpi/img_making_loading.png deleted file mode 100755 index c756c2e..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_making_loading.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_01.png b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_01.png new file mode 100644 index 0000000..e3941e3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_01.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_default.png b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_default.png new file mode 100755 index 0000000..8afe7af Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_a_default.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_menu_sample_b_default.png b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_b_default.png new file mode 100755 index 0000000..7abe171 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_b_default.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_menu_sample_c_default.png b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_c_default.png new file mode 100755 index 0000000..c1a7404 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_menu_sample_c_default.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_non_cart.png b/app/src/main/res/drawable-xxxhdpi/img_non_cart.png new file mode 100755 index 0000000..13d65d2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_non_cart.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_non_history.png b/app/src/main/res/drawable-xxxhdpi/img_non_history.png new file mode 100644 index 0000000..089c060 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_non_history.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_non_recent_order.png b/app/src/main/res/drawable-xxxhdpi/img_non_recent_order.png new file mode 100644 index 0000000..39cc6ba Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_non_recent_order.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_notice_loogo_mini.png b/app/src/main/res/drawable-xxxhdpi/img_notice_loogo_mini.png new file mode 100755 index 0000000..3bc9089 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_notice_loogo_mini.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_cantorder.png b/app/src/main/res/drawable-xxxhdpi/img_popup_cantorder.png new file mode 100755 index 0000000..db56479 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_cantorder.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_complete_menu.png b/app/src/main/res/drawable-xxxhdpi/img_popup_complete_menu.png new file mode 100644 index 0000000..5df35e7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_complete_menu.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_exit.png b/app/src/main/res/drawable-xxxhdpi/img_popup_exit.png new file mode 100755 index 0000000..d7e2f4c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_exit.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_payment_complete.png b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_complete.png new file mode 100644 index 0000000..666b128 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_complete.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_payment_confirm.png b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_confirm.png new file mode 100644 index 0000000..0733775 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_confirm.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_payment_error.png b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_error.png new file mode 100755 index 0000000..78dc40c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_payment_error.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_sold_out.png b/app/src/main/res/drawable-xxxhdpi/img_popup_sold_out.png new file mode 100755 index 0000000..e39be8c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_sold_out.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_store.png b/app/src/main/res/drawable-xxxhdpi/img_popup_store.png new file mode 100644 index 0000000..4618e26 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_store.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_popup_store_failed.png b/app/src/main/res/drawable-xxxhdpi/img_popup_store_failed.png new file mode 100755 index 0000000..f520e41 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_popup_store_failed.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_01_payment_finish.png b/app/src/main/res/drawable-xxxhdpi/img_process_01_payment_finish.png deleted file mode 100755 index 57d6324..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_process_01_payment_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_02_receive_finish.png b/app/src/main/res/drawable-xxxhdpi/img_process_02_receive_finish.png deleted file mode 100755 index 4a1416f..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_process_02_receive_finish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_03_making_01_sel.png b/app/src/main/res/drawable-xxxhdpi/img_process_03_making_01_sel.png deleted file mode 100755 index 15d7f68..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_process_03_making_01_sel.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_04_complete_yet.png b/app/src/main/res/drawable-xxxhdpi/img_process_04_complete_yet.png deleted file mode 100755 index 1f2c9c2..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_process_04_complete_yet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_dotline.png b/app/src/main/res/drawable-xxxhdpi/img_process_dotline.png deleted file mode 100755 index f618fa7..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_process_dotline.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_finish.png b/app/src/main/res/drawable-xxxhdpi/img_process_finish.png new file mode 100644 index 0000000..bf4ef8d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_process_finish.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_ing.png b/app/src/main/res/drawable-xxxhdpi/img_process_ing.png new file mode 100644 index 0000000..f359058 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_process_ing.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_process_yet.png b/app/src/main/res/drawable-xxxhdpi/img_process_yet.png new file mode 100644 index 0000000..3ae3735 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_process_yet.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_slidemenu_promotion.png b/app/src/main/res/drawable-xxxhdpi/img_slidemenu_promotion.png deleted file mode 100755 index d545947..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_slidemenu_promotion.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_state_line_dot.png b/app/src/main/res/drawable-xxxhdpi/img_state_line_dot.png new file mode 100755 index 0000000..41ebe35 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_state_line_dot.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_store_default.png b/app/src/main/res/drawable-xxxhdpi/img_store_default.png deleted file mode 100755 index 8f27ad3..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_store_default.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_store_default_02.png b/app/src/main/res/drawable-xxxhdpi/img_store_default_02.png deleted file mode 100755 index ce5f33c..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_store_default_02.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_store_suggest.png b/app/src/main/res/drawable-xxxhdpi/img_store_suggest.png deleted file mode 100755 index 905c6ff..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/img_store_suggest.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_storelogo_default.png b/app/src/main/res/drawable-xxxhdpi/img_storelogo_default.png new file mode 100755 index 0000000..b1ce266 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_storelogo_default.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_storelogo_sample_03.png b/app/src/main/res/drawable-xxxhdpi/img_storelogo_sample_03.png new file mode 100644 index 0000000..9c9aa63 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_storelogo_sample_03.png differ diff --git a/app/src/main/res/drawable/btn_main_menu.xml b/app/src/main/res/drawable/btn_main_menu.xml new file mode 100644 index 0000000..a8dd120 --- /dev/null +++ b/app/src/main/res/drawable/btn_main_menu.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_main_storechange.xml b/app/src/main/res/drawable/btn_main_storechange.xml new file mode 100644 index 0000000..f345f10 --- /dev/null +++ b/app/src/main/res/drawable/btn_main_storechange.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_menu_cart.xml b/app/src/main/res/drawable/btn_menu_cart.xml new file mode 100644 index 0000000..2ac34a2 --- /dev/null +++ b/app/src/main/res/drawable/btn_menu_cart.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_menu_close.xml b/app/src/main/res/drawable/btn_menu_close.xml new file mode 100644 index 0000000..a856fe6 --- /dev/null +++ b/app/src/main/res/drawable/btn_menu_close.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_num_minus.xml b/app/src/main/res/drawable/btn_num_minus.xml new file mode 100644 index 0000000..d34ac92 --- /dev/null +++ b/app/src/main/res/drawable/btn_num_minus.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_num_plus.xml b/app/src/main/res/drawable/btn_num_plus.xml new file mode 100644 index 0000000..5c07249 --- /dev/null +++ b/app/src/main/res/drawable/btn_num_plus.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_popup_r.xml b/app/src/main/res/drawable/btn_popup_r.xml new file mode 100644 index 0000000..23f6404 --- /dev/null +++ b/app/src/main/res/drawable/btn_popup_r.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_re_cart.xml b/app/src/main/res/drawable/btn_re_cart.xml new file mode 100644 index 0000000..62183f1 --- /dev/null +++ b/app/src/main/res/drawable/btn_re_cart.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_them_button.xml b/app/src/main/res/drawable/btn_them_button.xml new file mode 100644 index 0000000..2ff85f6 --- /dev/null +++ b/app/src/main/res/drawable/btn_them_button.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_type1_click_event.xml b/app/src/main/res/drawable/btn_type1_click_event.xml new file mode 100644 index 0000000..2320c79 --- /dev/null +++ b/app/src/main/res/drawable/btn_type1_click_event.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_type2_click_event.xml b/app/src/main/res/drawable/btn_type2_click_event.xml new file mode 100644 index 0000000..8fe4fd4 --- /dev/null +++ b/app/src/main/res/drawable/btn_type2_click_event.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_view_all.xml b/app/src/main/res/drawable/btn_view_all.xml new file mode 100644 index 0000000..52a1fb1 --- /dev/null +++ b/app/src/main/res/drawable/btn_view_all.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/catalog_text_color.xml b/app/src/main/res/drawable/catalog_text_color.xml deleted file mode 100644 index 32d371c..0000000 --- a/app/src/main/res/drawable/catalog_text_color.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/checkbox_item.xml b/app/src/main/res/drawable/checkbox_item.xml new file mode 100644 index 0000000..a1b391e --- /dev/null +++ b/app/src/main/res/drawable/checkbox_item.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/earth.jpg b/app/src/main/res/drawable/earth.jpg deleted file mode 100644 index 6cabbf4..0000000 Binary files a/app/src/main/res/drawable/earth.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/ic_drawer.png b/app/src/main/res/drawable/ic_drawer.png deleted file mode 100644 index fb681ba..0000000 Binary files a/app/src/main/res/drawable/ic_drawer.png and /dev/null differ diff --git a/app/src/main/res/drawable/listview_non_selector.xml b/app/src/main/res/drawable/listview_non_selector.xml new file mode 100644 index 0000000..54e9192 --- /dev/null +++ b/app/src/main/res/drawable/listview_non_selector.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/mars.jpg b/app/src/main/res/drawable/mars.jpg deleted file mode 100644 index db253ef..0000000 Binary files a/app/src/main/res/drawable/mars.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/mercury.jpg b/app/src/main/res/drawable/mercury.jpg deleted file mode 100644 index 531790b..0000000 Binary files a/app/src/main/res/drawable/mercury.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/neptune.jpg b/app/src/main/res/drawable/neptune.jpg deleted file mode 100644 index 88467c5..0000000 Binary files a/app/src/main/res/drawable/neptune.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/radio_item.xml b/app/src/main/res/drawable/radio_item.xml index 85aecbd..3963bc3 100644 --- a/app/src/main/res/drawable/radio_item.xml +++ b/app/src/main/res/drawable/radio_item.xml @@ -1,15 +1,10 @@ - - - - + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_admin.xml b/app/src/main/res/layout/activity_admin.xml new file mode 100644 index 0000000..7541a2f --- /dev/null +++ b/app/src/main/res/layout/activity_admin.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + +