Panagiotis Triantafyllou

refactor code

Showing 58 changed files with 180 additions and 724 deletions
# {@link ly.warp.sdk.utils.WarplyProperty}
# The app uuid the warply sdk need to connect to the engage server
# dev b13ade8ef743468b89a7aaa8efbfc468
# prod b13ade8ef743468b89a7aaa8efbfc468
Uuid=b13ade8ef743468b89a7aaa8efbfc468
# dev d5f9038f46374666a1f4e1039d89f608
# prod d5f9038f46374666a1f4e1039d89f608
# dev cosmote f83dfde1145e4c2da69793abb2f579af
# prod cosmote 0086a2088301440792091b9f814c2267
Uuid=d5f9038f46374666a1f4e1039d89f608
# If we need to see logs in Logcat
Debug=true
......@@ -11,11 +14,9 @@ Debug=true
# Production or Development environment of the engage server
# Production: https://engage.warp.ly
# Development: https://engage-stage.warp.ly
BaseURL=https://engage-stage.warp.ly
# Production: https://magenta.supermarketdeals.eu/
# Development: https://magenta-dev.supermarketdeals.eu/
SupermarketsURL=https://magenta-dev.supermarketdeals.eu/
# DEH Production: https://engage-prod.dei.gr
# DEH Development: https://engage-uat.dei.gr
BaseURL=https://engage-prod.dei.gr
# For Verify Ticket request
VerifyURL=/partners/cosmote/verify
......
No preview for this file type
......@@ -8,7 +8,6 @@
android:id="@+id/iv_splash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:src="@drawable/ic_cosmote_logo_horizontal_grey" />
android:scaleType="fitCenter"
android:src="@drawable/ic_logo" />
</RelativeLayout>
......
......@@ -630,11 +630,9 @@ public enum Warply {
try {
PackageInfo info = mContext.getPackageManager().getPackageInfo(mContext.getApplicationContext().getPackageName(), 0);
if (WarpUtils.getTrackersEnabled(mContext)) {
object.putOpt("app_version", info.versionName);
object.putOpt("sdk_version", WarpConstants.SDK_VERSION);
object.putOpt("app_build", info.versionCode);
}
// object.putOpt("bundle_identifier", mContext.get().getApplicationContext().getPackageName());
if (!WarpUtils.getHasApplicationInfo(mContext)) {
WarpUtils.setHasApplicationInfo(mContext, true);
......
......@@ -210,23 +210,23 @@ public class ProfileActivity extends Activity implements View.OnClickListener, O
private void filterCoupons(String status) {
// Reset all filter button styles
mBtnFilterActive.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterActive.setTextColor(getResources().getColor(R.color.black2));
mBtnFilterActive.setTextColor(getResources().getColor(R.color.custom_black2));
mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterFavorites.setTextColor(getResources().getColor(R.color.black2));
mBtnFilterFavorites.setTextColor(getResources().getColor(R.color.custom_black2));
mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.black2));
mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.custom_black2));
// Set selected filter button style
if (CouponItem.STATUS_ACTIVE.equals(status)) {
mBtnFilterActive.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterActive.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
mBtnFilterActive.setTextColor(Color.WHITE);
} else if (CouponItem.STATUS_FAVORITE.equals(status)) {
mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
mBtnFilterFavorites.setTextColor(Color.WHITE);
} else if (CouponItem.STATUS_REDEEMED.equals(status)) {
mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
mBtnFilterRedeemed.setTextColor(Color.WHITE);
}
......
......@@ -34,7 +34,6 @@ import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
......@@ -81,8 +80,6 @@ public class WarpViewActivity extends WarpBaseActivity {
// ===========================================================
private WarpView mWarpView;
private static Handler metersHandler;
private static boolean mWebviewSupermarket = false;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -91,8 +88,6 @@ public class WarpViewActivity extends WarpBaseActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
metersHandler = new Handler();
mWebviewSupermarket = false;
WarplySessionManager.onCreateActivity(this);
initViews();
Warply.getInitializer(this).init();
......@@ -112,16 +107,6 @@ public class WarpViewActivity extends WarpBaseActivity {
WarplySessionManager.onStartActivity(this);
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
if (mWarpView != null) {
if (getWebviewSupermarket()) {
String scriptSourceInit = "webviewDidFocusRefresh(" + String.valueOf(getWebviewSupermarket()) + ");";
mWarpView.evaluateJavascript(scriptSourceInit, s -> {
});
setWebviewSupermarket(false);
}
}
}
@Override
......@@ -134,10 +119,7 @@ public class WarpViewActivity extends WarpBaseActivity {
@Override
protected void onDestroy() {
super.onDestroy();
if (metersHandler != null) metersHandler.removeCallbacksAndMessages(null);
// WarplyManager.sendSteps(this);
WarpUtils.setWebviewParams(this, new JSONObject());
setWebviewSupermarket(false);
}
@Override
......@@ -166,7 +148,7 @@ public class WarpViewActivity extends WarpBaseActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 3002 || requestCode == 3003) {
if (requestCode == 3002) {
WarplyWebviewActivityCallbackEventModel webviewCallbackEventModel = new WarplyWebviewActivityCallbackEventModel();
webviewCallbackEventModel.setRequestId(requestCode);
webviewCallbackEventModel.setResponseCode(resultCode == RESULT_OK ? "enabled" : "disabled");
......@@ -311,12 +293,4 @@ public class WarpViewActivity extends WarpBaseActivity {
}
};
public static boolean getWebviewSupermarket() {
return mWebviewSupermarket;
}
public static void setWebviewSupermarket(boolean isLoaded) {
mWebviewSupermarket = isLoaded;
}
}
\ No newline at end of file
......
......@@ -5,11 +5,8 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
......@@ -19,16 +16,12 @@ import org.json.JSONObject;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.HomeActivity;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyManager;
public class HomeFragment extends Fragment implements View.OnClickListener {
private RelativeLayout mOptionOne, mOptionTwo, mOptionThree, mPbLoading;
private TextView mTvUsername, mTvUser;
private EditText mEtGuid;
private LinearLayout mLlAuthLogin, mLlAuthLogout, mRlSmFlow, mRlSmMap;
private RelativeLayout mPbLoading;
private LinearLayout mRlSmFlow;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
......@@ -38,51 +31,15 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mOptionOne = view.findViewById(R.id.info_button);
TextView mOptionOneText = mOptionOne.findViewById(R.id.option_text);
ImageView mOptionOneImage = mOptionOne.findViewById(R.id.option_icon);
mOptionOneText.setText("2");
mOptionOneImage.setImageResource(R.drawable.mobile_option);
mOptionTwo = view.findViewById(R.id.info_button2);
TextView mOptionTwoText = mOptionTwo.findViewById(R.id.option_text);
ImageView mOptionTwoImage = mOptionTwo.findViewById(R.id.option_icon);
mOptionTwoText.setText("1");
mOptionTwoImage.setImageResource(R.drawable.phone_option);
mOptionThree = view.findViewById(R.id.info_button3);
TextView mOptionThreeText = mOptionThree.findViewById(R.id.option_text);
ImageView mOptionThreeImage = mOptionThree.findViewById(R.id.option_icon);
mOptionThreeText.setText("1");
mOptionThreeImage.setImageResource(R.drawable.tv_option);
mTvUsername = view.findViewById(R.id.welcome_user_txt);
mPbLoading = view.findViewById(R.id.pb_loading);
mPbLoading.setOnTouchListener((v, event) -> true);
mEtGuid = view.findViewById(R.id.et_login);
mLlAuthLogin = view.findViewById(R.id.ll_auth_login);
mLlAuthLogin.setOnClickListener(this);
mLlAuthLogout = view.findViewById(R.id.ll_auth_logout);
mLlAuthLogout.setOnClickListener(this);
mTvUser = view.findViewById(R.id.tv_login);
mRlSmFlow = view.findViewById(R.id.ll_sm_flow);
mRlSmFlow.setOnClickListener(this);
mRlSmMap = view.findViewById(R.id.ll_sm_map);
mRlSmMap.setOnClickListener(this);
if (!WarplyDBHelper.getInstance(getActivity()).isTableNotEmpty("auth")) {
mTvUser.setVisibility(View.GONE);
mLlAuthLogout.setVisibility(View.GONE);
mLlAuthLogin.setVisibility(View.VISIBLE);
mEtGuid.setVisibility(View.VISIBLE);
} else {
mEtGuid.setVisibility(View.GONE);
mLlAuthLogin.setVisibility(View.GONE);
mLlAuthLogout.setVisibility(View.VISIBLE);
mTvUser.setVisibility(View.VISIBLE);
}
// 6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826
// prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179
mPbLoading.setVisibility(View.VISIBLE);
WarplyManager.getDehUser("aggeliki@warp.ly", mLoginReceiver);
}
@Override
......@@ -92,27 +49,24 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view.getId() == R.id.ll_auth_login) {
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
//prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179
// if (view.getId() == R.id.ll_auth_login) {
// //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
// //prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179
//// mPbLoading.setVisibility(View.VISIBLE);
//// WarplyManager.getDehUser(mEtGuid.getText().toString(), mLoginReceiver);
//
// Intent myIntent = new Intent(getContext(), HomeActivity.class);
// startActivity(myIntent);
// return;
// }
// if (view.getId() == R.id.ll_auth_logout) {
// mPbLoading.setVisibility(View.VISIBLE);
// WarplyManager.getCosmoteUser(mEtGuid.getText().toString(), mLoginReceiver);
// WarplyManager.logout(mLogoutReceiver);
// return;
// }
if (view.getId() == R.id.ll_sm_flow) {
Intent myIntent = new Intent(getContext(), HomeActivity.class);
startActivity(myIntent);
return;
}
if (view.getId() == R.id.ll_auth_logout) {
mPbLoading.setVisibility(View.VISIBLE);
WarplyManager.logout(mLogoutReceiver);
return;
}
if (view.getId() == R.id.ll_sm_flow) {
WarplyManagerHelper.openSupermarketsFlow(getContext());
return;
}
if (view.getId() == R.id.ll_sm_map) {
WarplyManagerHelper.openSupermarketsMap(getContext());
}
}
......@@ -124,11 +78,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
private final CallbackReceiver<JSONObject> mLogoutReceiver = new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
mTvUser.setVisibility(View.GONE);
mPbLoading.setVisibility(View.GONE);
mLlAuthLogout.setVisibility(View.GONE);
mLlAuthLogin.setVisibility(View.VISIBLE);
mEtGuid.setVisibility(View.VISIBLE);
Toast.makeText(getActivity(), "LOGOUT SUCCESS", Toast.LENGTH_SHORT).show();
}
......@@ -143,11 +93,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
@Override
public void onSuccess(JSONObject result) {
mPbLoading.setVisibility(View.GONE);
mLlAuthLogin.setVisibility(View.GONE);
mEtGuid.setVisibility(View.GONE);
mLlAuthLogout.setVisibility(View.VISIBLE);
mTvUser.setVisibility(View.VISIBLE);
mTvUser.setText(mEtGuid.getText().toString());
Toast.makeText(getActivity(), "LOGIN SUCCESS", Toast.LENGTH_SHORT).show();
}
@Override
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
import java.util.HashMap;
/**
* Created by Panagiotis Triantafyllou on 21-Oct-22.
*/
public class LoyaltySDKDynatraceEventModel {
private String eventName;
private HashMap<String, String> parameters;
public LoyaltySDKDynatraceEventModel() {
this.eventName = "";
this.parameters = new HashMap();
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public HashMap<String, String> getParameters() {
return parameters;
}
public void setParameter(String key, String value) {
this.parameters.put(key, value);
}
}
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
import java.util.HashMap;
/**
* Created by Panagiotis Triantafyllou on 25-May-22.
*/
public class LoyaltySDKFirebaseEventModel {
private String eventName;
private HashMap<String, String> parameters;
public LoyaltySDKFirebaseEventModel() {
this.eventName = "";
this.parameters = new HashMap();
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public HashMap<String, String> getParameters() {
return parameters;
}
public void setParameter(String key, String value) {
this.parameters.put(key, value);
}
}
......@@ -31,16 +31,14 @@ public interface ApiService {
// ===========================================================
@Headers("Content-Type: application/json")
@POST("/partners/oauth/{appUuid}/token")
Call<ResponseBody> cosmoteUser(@Path("appUuid") String appUuid,
@Body RequestBody request,
@POST("/partners/dei/app_login")
Call<ResponseBody> dehUser(@Body RequestBody request,
@Header(WarpConstants.HEADER_DATE) String timeStamp,
@Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId,
@Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId,
@Header(WarpConstants.HEADER_CHANNEL) String channel,
@Header(WarpConstants.HEADER_WEB_ID) String webId,
@Header(WarpConstants.HEADER_SIGNATURE) String signature,
@Header(WarpConstants.HEADER_AUTHORIZATION) String basic);
@Header(WarpConstants.HEADER_SIGNATURE) String signature);
@Headers("Content-Type: application/json")
@POST("/partners/cosmote/verify")
......
package ly.warp.sdk.services;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
/**
* Created by Panagiotis Triantafyllou on 05/Sept/2022.
*/
public class EventRewardsCouponsService extends Worker {
public EventRewardsCouponsService(@NonNull Context context, @NonNull WorkerParameters workerParams) {
super(context, workerParams);
}
@NonNull
@Override
public Result doWork() {
return Result.success();
}
}
......@@ -70,13 +70,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
import ly.warp.sdk.R;
import ly.warp.sdk.services.EventRefreshDeviceTokenService;
import ly.warp.sdk.utils.constants.WarpConstants;
......@@ -103,7 +101,7 @@ public class WarpUtils {
private static final String PREFERENCES_KEY_GCM_ENABLED = PREFERENCES_PREFIX
+ "gcm_enabled";
private static final String PREFERENCES_KEY_LAST_APPLICATION_UUID = PREFERENCES_PREFIX
+ "last_appplixation_uuid";
+ "last_application_uuid";
private static final String PREFERENCES_KEY_TIMESTAMP = PREFERENCES_PREFIX
+ "timestamp";
private static final String PREFERENCES_KEY_DEVICE_TOKEN = PREFERENCES_PREFIX
......@@ -138,28 +136,10 @@ public class WarpUtils {
+ "device_info_data";
private static final String PREFERENCES_KEY_LIFECYCLE_ANALYTICS_ENABLED = PREFERENCES_PREFIX
+ "lifecycle_analytics_enabled";
private static final String PREFERENCES_KEY_GIFTS_POPUP = PREFERENCES_PREFIX
+ "gifts_popup";
private static final String PREFERENCES_KEY_MORE_POPUP = PREFERENCES_PREFIX
+ "more_popup";
private static final String PREFERENCES_KEY_USER_TAG = PREFERENCES_PREFIX
+ "user_badge";
private static final String PREFERENCES_KEY_WEBVIEW_PARAMS = PREFERENCES_PREFIX
+ "webview_params";
private static final String PREFERENCES_STEPS_COUNTER = PREFERENCES_PREFIX
+ "steps_counter";
private static final String PREFERENCES_KEY_USER_NON_TELCO = PREFERENCES_PREFIX
+ "user_non_telco";
private static final String PREFERENCES_STEPS_METERS_COUNTER = PREFERENCES_PREFIX
+ "steps_meters_counter";
private static final String PREFERENCES_TRACKERS_ENABLED = PREFERENCES_PREFIX
+ "trackers_enabled";
private static final String PREFERENCES_KEY_LANGUAGE = PREFERENCES_PREFIX
+ "language";
private static final String PREFERENCES_KEY_STEPS = PREFERENCES_PREFIX
+ "steps";
private static final String PREFERENCES_KEY_STEPS_MANUALLY_STOPPED = PREFERENCES_PREFIX
+ "steps_manually_stopped";
private static final String PREFERENCES_KEY_JWT_ENABLED = PREFERENCES_PREFIX
+ "jwt_enabled";
private static final String PREFERENCES_KEY_APP_LOCALE = PREFERENCES_PREFIX
......@@ -195,36 +175,6 @@ public class WarpUtils {
editor.apply();
}
public static boolean getIsSteps(Context context) {
return getPreferences(context).getBoolean(PREFERENCES_KEY_STEPS, false);
}
public static void setIsSteps(Context context, boolean isSteps) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_KEY_STEPS, isSteps);
editor.apply();
}
public static boolean getIsStepsManuallyStopped(Context context) {
return getPreferences(context).getBoolean(PREFERENCES_KEY_STEPS_MANUALLY_STOPPED, false);
}
public static void setIsStepsManuallyStopped(Context context, boolean isManuallyStopped) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_KEY_STEPS_MANUALLY_STOPPED, isManuallyStopped);
editor.apply();
}
public static String getUserTag(Context context) {
return getPreferences(context).getString(PREFERENCES_KEY_USER_TAG, "");
}
public static void setUserTag(Context context, String userTag) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putString(PREFERENCES_KEY_USER_TAG, userTag);
editor.apply();
}
public static String getLanguage(Context context) {
return getPreferences(context).getString(PREFERENCES_KEY_LANGUAGE, "el");
}
......@@ -235,16 +185,6 @@ public class WarpUtils {
editor.apply();
}
public static boolean getUserNonTelco(Context context) {
return getPreferences(context).getBoolean(PREFERENCES_KEY_USER_NON_TELCO, false);
}
public static void setUserNonTelco(Context context, boolean userNonTelco) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_KEY_USER_NON_TELCO, userNonTelco);
editor.apply();
}
/**
* Method used to return the token of this device for the GCM service
*
......@@ -255,7 +195,6 @@ public class WarpUtils {
}
public static void setRegistrationGCM(Context context, String registrationGCM) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putString(PREFERENCES_KEY_REGISTRATION_GCM, registrationGCM);
editor.apply();
......@@ -283,36 +222,10 @@ public class WarpUtils {
editor.apply();
}
public static boolean getGiftsPopup(Context context) {
SharedPreferences prefs = getPreferences(context);
return prefs.getBoolean(PREFERENCES_KEY_GIFTS_POPUP, true);
}
public static void setGiftsPopup(Context context, boolean visible) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_KEY_GIFTS_POPUP, visible);
editor.apply();
}
public static boolean getMorePopup(Context context) {
SharedPreferences prefs = getPreferences(context);
return prefs.getBoolean(PREFERENCES_KEY_MORE_POPUP, true);
}
public static void setMorePopup(Context context, boolean visible) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_KEY_MORE_POPUP, visible);
editor.apply();
}
public static boolean isRegisteredWarply(Context context) {
return !("".equalsIgnoreCase(getWebId(context)));
}
public static void invalidateRegistrationWarply(Context context) {
setWebId(context, "");
}
private static SharedPreferences getPreferences(Context context) {
if (_prefs == null) {
try {
......@@ -708,39 +621,6 @@ public class WarpUtils {
return prefs.getString(PREFERENCES_KEY_WEBVIEW_PARAMS, "");
}
public static synchronized void setStepsCounter(Context context, int counter) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putInt(PREFERENCES_STEPS_COUNTER, counter);
editor.apply();
}
public static synchronized int getStepsCounter(Context context) {
SharedPreferences prefs = getPreferences(context);
return prefs.getInt(PREFERENCES_STEPS_COUNTER, 0);
}
public static void setStepsMetersCounter(Context context, double counter) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putLong(PREFERENCES_STEPS_METERS_COUNTER, Double.doubleToRawLongBits(counter));
editor.apply();
}
public static double getStepsMetersCounter(Context context) {
SharedPreferences prefs = getPreferences(context);
return Double.longBitsToDouble(prefs.getLong(PREFERENCES_STEPS_METERS_COUNTER, 0));
}
public static void setTrackersEnabled(Context context, boolean isEnabled) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_TRACKERS_ENABLED, isEnabled);
editor.apply();
}
public static boolean getTrackersEnabled(Context context) {
SharedPreferences prefs = getPreferences(context);
return prefs.getBoolean(PREFERENCES_TRACKERS_ENABLED, false);
}
public static JSONObject getDeviceInfoObject(Context context) {
SharedPreferences prefs = getPreferences(context);
try {
......
......@@ -72,14 +72,11 @@ public class WarplyDeviceInfoCollector {
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext) == ConnectionResult.SUCCESS) {
//Google Play Services are available
try {
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("registration_gcm", getRegistrationGCM());
jObj.putOpt("vendor", "google");
jObj.putOpt("unique_device_id", getUniqueDeviceId());
......@@ -91,14 +88,11 @@ public class WarplyDeviceInfoCollector {
} else {
//Google Play Services are not available, or not updated
try {
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("vendor", "huawei");
jObj.putOpt("registration_gcm", getRegistrationGCM());
jObj.putOpt("unique_device_id", getUniqueDeviceId());
......@@ -122,14 +116,11 @@ public class WarplyDeviceInfoCollector {
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext) == ConnectionResult.SUCCESS) {
//Google Play Services are available
try {
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("vendor", "google");
} catch (JSONException e) {
......@@ -140,14 +131,11 @@ public class WarplyDeviceInfoCollector {
} else {
//Google Play Services are not available, or not updated
try {
if (WarpUtils.getTrackersEnabled(mContext)) {
jObj.putOpt("platform", "android");
jObj.putOpt("manufacturer", getDeviceManufacturer());
jObj.putOpt("android_phone_model", getDeviceModel());
jObj.putOpt("os_version", getOsVersion());
jObj.putOpt("app_version", getAppVersion());
}
jObj.putOpt("unique_device_id", getUniqueDeviceId());
jObj.putOpt("vendor", "huawei");
} catch (JSONException e) {
......
......@@ -25,19 +25,15 @@
package ly.warp.sdk.utils;
import android.content.Context;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import ly.warp.sdk.Warply;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.utils.constants.WarpConstants;
import ly.warp.sdk.utils.managers.WarplyManager;
/**
......@@ -55,8 +51,7 @@ public class WarplyManagerHelper {
// ===========================================================
private static CouponList mCouponRedeemedList = new CouponList();
private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>(),
mSupermarketCampaigns = new ArrayList<Campaign>();
private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -66,20 +61,11 @@ public class WarplyManagerHelper {
// Methods
// ===========================================================
public static void setTrackersEnabled(Context context, boolean isEnabled) {
WarpUtils.setTrackersEnabled(context, isEnabled);
}
public static void setCampaignList(ArrayList<Campaign> campaignList) {
mCampaignListAll.clear();
mCampaignListAll.addAll(campaignList);
}
public static void setSupermarketCampaigns(ArrayList<Campaign> campaignList) {
mSupermarketCampaigns.clear();
mSupermarketCampaigns.addAll(campaignList);
}
public static void setCouponRedeemedList(CouponList couponRedeemedList) {
mCouponRedeemedList.clear();
mCouponRedeemedList.addAll(couponRedeemedList);
......@@ -140,78 +126,6 @@ public class WarplyManagerHelper {
return url;
}
public static void openSupermarketsFlow(Context context) {
if (mSupermarketCampaigns == null || mSupermarketCampaigns.isEmpty()) {
return;
}
JSONObject params = new JSONObject();
try {
params.putOpt("web_id", WarpUtils.getWebId(context));
params.putOpt("app_uuid", WarplyProperty.getAppUuid(context));
params.putOpt("api_key", WarpUtils.getApiKey(context));
params.putOpt("session_uuid", "");
params.putOpt("access_token", WarplyDBHelper.getInstance(context).getAuthValue("access_token"));
params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token"));
params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id"));
params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret"));
params.putOpt("lan", WarpUtils.getApplicationLocale(context));
params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context)));
} catch (JSONException e) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(context, params);
context.startActivity(WarpViewActivity.createIntentFromURL(context, WarplyManagerHelper.constructCampaignUrl(mSupermarketCampaigns.get(0))));
}
public static void openSupermarketsMap(Context context) {
JSONObject params = new JSONObject();
try {
params.putOpt("web_id", WarpUtils.getWebId(context));
params.putOpt("app_uuid", WarplyProperty.getAppUuid(context));
params.putOpt("api_key", WarpUtils.getApiKey(context));
params.putOpt("session_uuid", "");
params.putOpt("access_token", WarplyDBHelper.getInstance(context).getAuthValue("access_token"));
params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token"));
params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id"));
params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret"));
params.putOpt("map", "true");
params.putOpt("lan", WarpUtils.getApplicationLocale(context));
params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context)));
} catch (JSONException e) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(context, params);
context.startActivity(WarpViewActivity.createIntentFromURL(context, (WarplyProperty.getSupermarketsUrl(context) + WarpConstants.SUPERMARKETS_MAP)));
}
public static void openContest(Context context) {
final String mContestUrl = "https://warply.s3.amazonaws.com/dei/campaigns/DehEasterContest_stage/index.html";
JSONObject params = new JSONObject();
try {
params.putOpt("web_id", WarpUtils.getWebId(context));
params.putOpt("app_uuid", WarplyProperty.getAppUuid(context));
params.putOpt("api_key", WarpUtils.getApiKey(context));
params.putOpt("session_uuid", "");
params.putOpt("access_token", WarplyDBHelper.getInstance(context).getAuthValue("access_token"));
params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token"));
params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id"));
params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret"));
params.putOpt("lan", WarpUtils.getApplicationLocale(context));
params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context)));
} catch (JSONException e) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(context, params);
context.startActivity(WarpViewActivity.createIntentFromURL(context, mContestUrl));
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
......
......@@ -49,7 +49,6 @@ public class WarplyProperty {
public static final String KEY_LOGIN_TYPE = "LoginType";
public static final String KEY_DL_URL_SCHEME = "DL_URL_SCHEME";
public static final String KEY_BASE_URL = "BaseURL";
public static final String KEY_SUPERMARKETS_URL = "SupermarketsURL";
public static final String KEY_VERIFY_URL = "VerifyURL";
// ===========================================================
......@@ -205,10 +204,6 @@ public class WarplyProperty {
return getWarplyProperty(context, KEY_BASE_URL);
}
public static String getSupermarketsUrl(Context context) {
return getWarplyProperty(context, KEY_SUPERMARKETS_URL);
}
public static String getVerifyUrl(Context context) {
return getWarplyProperty(context, KEY_VERIFY_URL);
}
......
package ly.warp.sdk.utils.managers;
import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.io.models.WarplyWebviewActivityCallbackEventModel;
import ly.warp.sdk.io.models.WarplyWebviewCallbackEventModel;
......@@ -10,8 +8,6 @@ import ly.warp.sdk.io.models.WarplyWebviewCallbackEventModel;
* Created by Panagiotis Triantafyllou on 26/Απρ/2022.
*/
public class WarplyEventBusManager {
private LoyaltySDKFirebaseEventModel fireEvent;
private LoyaltySDKDynatraceEventModel dynatraceEvent;
private WarplyWebviewCallbackEventModel webviewCallback;
private WarplyWebviewActivityCallbackEventModel webviewActivityCallback;
private QuestionnaireEventModel questionnaire;
......@@ -28,14 +24,6 @@ public class WarplyEventBusManager {
this.webviewActivityCallback = webviewActivityCallback;
}
public WarplyEventBusManager(LoyaltySDKFirebaseEventModel fireEvent) {
this.fireEvent = fireEvent;
}
public WarplyEventBusManager(LoyaltySDKDynatraceEventModel dynatraceEvent) {
this.dynatraceEvent = dynatraceEvent;
}
public WarplyWebviewCallbackEventModel getWarplyWebviewCallbackEventModel() {
return webviewCallback;
}
......
......@@ -81,10 +81,7 @@ import java.util.Map;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyProperty;
......@@ -101,7 +98,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private static final String URL_ACTION_MAIL = "mailto";
private static final String URL_ACTION_MARKET = "market";
private static final String URL_ACTION_INTENT = "intent";
private static final String URL_ACTION_MAPS = "geo";
private static final String URL_FALLBACK_MAPS = "https://www.google.com/maps/search/?api=1&query=";
private static final String URL_ACTION_MARKET_AUTHORITY = "play.google.com";
......@@ -175,7 +171,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
settings.setAllowUniversalAccessFromFileURLs(true);
settings.setSupportMultipleWindows(true);
// settings.setGeolocationDatabasePath(getContext().getFilesDir().getPath());
WarpView.this.addJavascriptInterface(new JSInterface(), "Cosmote");
WarpView.this.addJavascriptInterface(new JSInterface(), "DEH");
setBackgroundColor(ContextCompat.getColor(getContext(), android.R.color.transparent));
setWebViewClient(new WarplyWebViewClient());
setWebChromeClient(new WarplyWebChromeClient());
......@@ -454,11 +450,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
public void sendMessage(String message) {
if (message.contains("event")) {
String[] parts = message.split(":");
if (parts[1].equals("webviewRefresh")) {
WarpViewActivity.setWebviewSupermarket(true);
} else if (parts[1].equals("closeArtwork")) {
WarpViewActivity.setWebviewSupermarket(false);
if (parts[1].equals("closeArtwork")) {
QuestionnaireEventModel questionnaireEvent = new QuestionnaireEventModel();
questionnaireEvent.setName(parts[1]);
EventBus.getDefault().post(new WarplyEventBusManager(questionnaireEvent));
......@@ -466,62 +458,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
WarpUtils.log("**************** WARPLY Webview Log START *****************");
WarpUtils.log(message);
WarpUtils.log("**************** WARPLY Webview Log END *****************");
} else if (parts[1].equals("loyalty_questionnaire_selected")) {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName(parts[1]);
analyticsEvent.setParameter("completed", "true");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} else if (parts[1].equals("loyalty_questionnaire_answer_again") || parts[1].equals("loyalty_questionnaire_answers_deleted")) {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName(parts[1]);
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} else if (parts[1].equals("loyalty_questionnaire_later")) {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_questionnaire_selected");
analyticsEvent.setParameter("completed", "false");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} else if (parts[1].equals("loyalty_sdk_offer_selected")) {
try {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_sdk_offer_selected");
analyticsEvent.setParameter("name", parts[2]);
analyticsEvent.setParameter("type", parts[3]);
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} catch (Exception e) {
e.printStackTrace();
}
} else if (parts[1].equals("loyalty_offer_activated")) {
try {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_sdk_offer_selected");
analyticsEvent.setParameter("name", parts[2]);
analyticsEvent.setParameter("type", parts[3]);
analyticsEvent.setParameter("successful", parts[4]);
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} catch (Exception e) {
e.printStackTrace();
}
} else if (parts[1].equals("unified_coupon_activated")) {
try {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_sdk_unified_activated");
analyticsEvent.setParameter("name", parts[2]);
analyticsEvent.setParameter("type", parts[3]);
analyticsEvent.setParameter("successful", parts[4]);
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} catch (Exception e) {
e.printStackTrace();
}
} else if (parts[1].equals("time_spent_on_loyalty_sdk")) {
try {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("time_spent_on_loyalty_sdk");
analyticsEvent.setParameter("name", parts[2]);
analyticsEvent.setParameter("seconds", parts[3]);
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
} catch (Exception e) {
e.printStackTrace();
}
} else if (parts[1].equals("refreshToken")) {
try {
if (Warply.getWarplyContext() != null) {
......@@ -530,30 +466,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
} catch (Exception e) {
e.printStackTrace();
}
} else if (parts[1].equals("cancel_unified_success")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_cancel_unified_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
} else if (parts[1].equals("cancel_unified_failed")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_cancel_unified_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
} else if (parts[1].equals("create_unified_success")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_create_unified_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
} else if (parts[1].equals("create_unified_failed")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_create_unified_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
} else if (parts[1].equals("get_unified_success")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_unified_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
} else if (parts[1].equals("get_unified_failed")) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_unified_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
}
}
}
......@@ -571,8 +483,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
builder.setTitle(getContext().getString(R.string.webview_permission_title));
builder.setMessage(getContext().getString(R.string.webview_permission_message))
.setCancelable(false)
.setPositiveButton(getContext().getString(R.string.lbl_take_photo_accept), (dialog, id) -> checkForPermissions(origin, callback))
.setNegativeButton(getContext().getString(R.string.lbl_take_photo_decline), (dialog, id) -> callback.invoke(origin, false, false));
.setPositiveButton(getContext().getString(R.string.lbl_ok), (dialog, id) -> checkForPermissions(origin, callback))
.setNegativeButton(getContext().getString(R.string.lbl_cancel), (dialog, id) -> callback.invoke(origin, false, false));
AlertDialog alert = builder.create();
alert.show();
}
......@@ -603,7 +515,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
geolocationOrigin = origin;
geolocationCallback = callback;
} else {
//TODO: show infromative popup and go to settings
//TODO: show informative popup and go to settings
}
}
}
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:autoMirrored="true">
<path
android:fillColor="@android:color/black"
android:pathData="M180,840Q156,840 138,822Q120,804 120,780L120,180Q120,156 138,138Q156,120 180,120L479,120L479,180L180,180Q180,180 180,180Q180,180 180,180L180,780Q180,780 180,780Q180,780 180,780L479,780L479,840L180,840ZM666,655L623,612L725,510L360,510L360,450L723,450L621,348L664,305L840,481L666,655Z"/>
</vector>
......@@ -3,5 +3,5 @@
android:shape="oval">
<corners android:radius="1000dp" />
<solid android:color="@color/pink" />
<solid android:color="@color/custom_pink" />
</shape>
\ No newline at end of file
......
......@@ -6,5 +6,5 @@
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/black2" />
android:color="@color/custom_black2" />
</shape>
\ No newline at end of file
......
......@@ -6,5 +6,5 @@
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/grey" />
android:color="@color/custom_grey" />
</shape>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/pink3" />
<solid android:color="@color/custom_pink3" />
<size android:width="8dp" android:height="8dp" />
</shape>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/grey2" />
<solid android:color="@color/custom_grey2" />
<size android:width="8dp" android:height="8dp" />
</shape>
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_cos_black_tr" android:state_pressed="true" />
<item android:drawable="@drawable/shape_cos_black" android:state_pressed="false" />
<item android:drawable="@drawable/shape_rectangle_rounded_black_tr" android:state_pressed="true" />
<item android:drawable="@drawable/shape_rectangle_rounded_black" android:state_pressed="false" />
</selector>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_cos_green_tr" android:state_pressed="true" />
<item android:drawable="@drawable/shape_cos_green" android:state_pressed="false" />
<item android:drawable="@drawable/shape_rectangle_rounded_green_tr" android:state_pressed="true" />
<item android:drawable="@drawable/shape_rectangle_rounded_green" android:state_pressed="false" />
</selector>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_rectangle_rounded_light_blue_tr" android:state_pressed="true" />
<item android:drawable="@drawable/shape_rectangle_rounded_light_blue" android:state_pressed="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/cos_cyan" />
<item android:color="@color/cos_grey_dark" />
<item android:state_checked="true" android:color="@color/custom_cyan" />
<item android:color="@color/custom_grey_dark" />
</selector>
\ No newline at end of file
......
......@@ -5,5 +5,5 @@
<solid
android:width="2dp"
android:color="@color/black2" />
android:color="@color/custom_black2" />
</shape>
\ No newline at end of file
......
......@@ -5,5 +5,5 @@
<solid
android:width="2dp"
android:color="@color/black2_tr" />
android:color="@color/custom_black2_tr" />
</shape>
\ No newline at end of file
......
......@@ -5,5 +5,5 @@
<solid
android:width="2dp"
android:color="@color/cos_green12" />
android:color="@color/custom_green12" />
</shape>
\ No newline at end of file
......
......@@ -5,5 +5,5 @@
<solid
android:width="2dp"
android:color="@color/cos_green6_tr" />
android:color="@color/custom_green6_tr" />
</shape>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="16dp" />
<solid
android:width="2dp"
android:color="@color/custom_light_blue" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="16dp" />
<solid
android:width="2dp"
android:color="@color/custom_light_blue" />
</shape>
\ No newline at end of file
......@@ -7,5 +7,5 @@
<stroke
android:width="1dp"
android:color="@color/black2" />
android:color="@color/custom_black2" />
</shape>
\ No newline at end of file
......
......@@ -7,5 +7,5 @@
<stroke
android:width="1dp"
android:color="@color/black2_tr" />
android:color="@color/custom_black2_tr" />
</shape>
\ No newline at end of file
......
......@@ -19,7 +19,7 @@
style="@style/BottomNavigationView"
android:background="@android:color/white"
app:itemTextColor="@drawable/selector_tab_title_color"
app:itemRippleColor="@color/cos_cyan"
app:itemRippleColor="@color/custom_cyan"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey_light">
android:background="@color/custom_grey_light">
<androidx.core.widget.NestedScrollView
android:id="@+id/home_scrollview"
......@@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/cos_grey_light"
android:background="@color/custom_grey_light"
android:orientation="horizontal"
android:padding="16dp">
......@@ -71,7 +71,7 @@
android:id="@+id/dots_container"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/cos_grey_light"
android:background="@color/custom_grey_light"
android:gravity="center"
android:orientation="horizontal"
android:padding="4dp"
......@@ -99,7 +99,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Top Offers (10)" />
......@@ -111,7 +111,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -145,7 +145,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Favorites (10)" />
......@@ -157,7 +157,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -191,7 +191,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Viability (10)" />
......@@ -203,7 +203,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -237,7 +237,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Family (10)" />
......@@ -249,7 +249,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -283,7 +283,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Food and Coffee (10)" />
......@@ -295,7 +295,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -329,7 +329,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Travelling (10)" />
......@@ -341,7 +341,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -375,7 +375,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Kids (10)" />
......@@ -387,7 +387,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -422,7 +422,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Purchases (10)" />
......@@ -434,7 +434,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......
......@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey_light">
android:background="@color/custom_grey_light">
<androidx.core.widget.NestedScrollView
android:id="@+id/profile_scrollview"
......@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_profile"
android:textColor="@color/black4"
android:textColor="@color/custom_black4"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
......@@ -57,7 +57,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:background="@color/cos_grey_light"
android:background="@color/custom_grey_light"
android:orientation="horizontal"
android:padding="16dp">
......@@ -117,7 +117,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
tools:text="Προτάσεις για εσένα (5)" />
......@@ -129,7 +129,7 @@
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="14sp" />
</LinearLayout>
......@@ -160,7 +160,7 @@
android:layout_marginVertical="8dp"
android:paddingHorizontal="16dp"
android:text="@string/demo_my_coupons"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp" />
<!-- Filter Buttons -->
......@@ -179,7 +179,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/shape_cos_black"
android:background="@drawable/shape_rectangle_rounded_black"
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_active"
......@@ -196,7 +196,7 @@
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_favorites"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="14sp" />
<TextView
......@@ -208,7 +208,7 @@
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_redeemed"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="14sp" />
</LinearLayout>
......
......@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey_light">
android:background="@color/custom_grey_light">
<ScrollView
android:id="@+id/coupon_scrollview"
......@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_offer"
android:textColor="@color/black4"
android:textColor="@color/custom_black4"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
......@@ -90,7 +90,7 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_more"
android:textColor="@color/black4"
android:textColor="@color/custom_black4"
android:textSize="11sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -126,7 +126,7 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/pink2"
android:textColor="@color/custom_pink2"
android:textSize="23sp"
tools:text="@string/demo_more" />
......@@ -139,7 +139,7 @@
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/demo_purchases"
android:textColor="@color/black5"
android:textColor="@color/custom_black5"
android:textSize="17sp" />
</LinearLayout>
......@@ -171,7 +171,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:includeFontPadding="false"
android:textColor="@color/black5"
android:textColor="@color/custom_black5"
android:textSize="13sp"
tools:text="@string/demo_purchases" />
......@@ -183,7 +183,7 @@
android:ellipsize="end"
android:lineSpacingExtra="2dp"
android:maxLines="4"
android:textColor="@color/black5"
android:textColor="@color/custom_black5"
android:textSize="17sp"
tools:text="Πάρτε τα πακέτα κινητής στη μισή τιμή μόνο αυτό το μήνα. Απεριόριστα λεπτά προς όλα τα δίκτυα, SMS και 50GB δεδομένα υψηλής ταχύτητας. Ισχύει για νέους συνδρομητές και ανανεώσεις συμβολαίων. Δωρεάν ενεργοποίηση και τεχνική υποστήριξη." />
......@@ -194,7 +194,7 @@
android:layout_gravity="end"
android:layout_marginTop="2dp"
android:text="@string/demo_more"
android:textColor="@color/skyblue"
android:textColor="@color/custom_skyblue"
android:textSize="15sp"
android:visibility="gone" />
......@@ -203,7 +203,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:background="@drawable/shape_cos_white"
android:background="@drawable/shape_rectangle_rounded_white"
android:orientation="vertical"
android:padding="16dp">
......@@ -220,7 +220,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/demo_coupon_code"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="15sp" />
<ImageView
......@@ -247,7 +247,7 @@
android:layout_marginEnd="12dp"
android:includeFontPadding="false"
android:text="test_coupon_code"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="23sp" />
<ImageView
......@@ -263,7 +263,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/shape_cos_white"
android:background="@drawable/shape_rectangle_rounded_white"
android:orientation="vertical"
android:padding="16dp">
......@@ -280,7 +280,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/demo_qr_code"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="15sp" />
<ImageView
......@@ -329,7 +329,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/demo_terms"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="15sp"/>
<ImageView
......@@ -356,7 +356,7 @@
android:layout_marginBottom="8dp"
android:lineSpacingExtra="4dp"
android:text="@string/demo_lorem_ipsum"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
......@@ -392,7 +392,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/demo_website"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/option_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:src="@drawable/phone_option"/>
<TextView
android:id="@+id/option_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:layout_marginLeft="30dp"
android:layout_marginTop="14dp"/>
</RelativeLayout>
......@@ -52,7 +52,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="21sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
......@@ -65,7 +65,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="2"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="15sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
......@@ -81,7 +81,7 @@
android:layout_centerVertical="true"
android:layout_marginTop="24dp"
android:maxLines="1"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
......
......@@ -56,7 +56,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/black2"
android:textColor="@color/custom_black2"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
......@@ -70,7 +70,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:maxLines="2"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
......@@ -86,7 +86,7 @@
android:layout_centerVertical="true"
android:layout_marginTop="12dp"
android:maxLines="1"
android:textColor="@color/black3"
android:textColor="@color/custom_black3"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Used in drawables -->
<color name="cos_cyan">#A3F2DA</color>
<color name="cos_grey_dark">#787878</color>
<color name="cos_grey_light">#F2F2F2</color>
<color name="cos_green12">#0EA600</color>
<color name="cos_green6_tr">#660EA600</color>
<color name="cos_orange">#FF9933</color>
<!-- Used in layouts -->
<color name="cos_skyblue2">#22A9B5</color>
<color name="blue_dark">#3A5266</color>
<color name="custom_cyan">#A3F2DA</color>
<color name="custom_grey_dark">#787878</color>
<color name="custom_grey_light">#F2F2F2</color>
<color name="custom_green12">#0EA600</color>
<color name="custom_green6_tr">#660EA600</color>
<color name="custom_orange">#FF9933</color>
<color name="custom_skyblue2">#22A9B5</color>
<color name="custom_blue_dark">#3A5266</color>
<color name="white">#FFFFFF</color>
<color name="white_tr">#66FFFFFF</color>
<color name="cos_green5">#79BF14</color>
<color name="black2">#000F1E</color>
<color name="black2_tr">#66000F1E</color>
<color name="black3">#00111B</color>
<color name="grey">#CCCCCC</color>
<color name="pink">#EE417D</color>
<color name="black4">#0D1B29</color>
<color name="black5">#020E1C</color>
<color name="pink2">#F2709D</color>
<color name="skyblue">#00A3E0</color>
<color name="grey2">#D8D8D8</color>
<color name="pink3">#EE437E</color>
<!-- Used in styles -->
<color name="cos_light_blue">#00A5E3</color>
<color name="custom_green5">#79BF14</color>
<color name="custom_black2">#000F1E</color>
<color name="custom_black2_tr">#66000F1E</color>
<color name="custom_black3">#00111B</color>
<color name="custom_grey">#CCCCCC</color>
<color name="custom_pink">#EE417D</color>
<color name="custom_black4">#0D1B29</color>
<color name="custom_black5">#020E1C</color>
<color name="custom_pink2">#F2709D</color>
<color name="custom_skyblue">#00A3E0</color>
<color name="custom_grey2">#D8D8D8</color>
<color name="custom_pink3">#EE437E</color>
<color name="custom_light_blue">#00A5E3</color>
</resources>
......
<resources>
<string name="webview_permission_title">Demo App</string>
<string name="webview_permission_message">Το Demo App ζητάει πρόσβαση στην τοποθεσία σας.</string>
<string name="lbl_take_photo_accept">Οκ</string>
<string name="lbl_take_photo_decline">Άκυρο</string>
<string name="welcome_user">Γεια σου %1$s !</string>
<string name="cos_hint">GUID</string>
<string name="cos_login_text">Σύνδεση</string>
<string name="cos_logout_text">Αποσύνδεση</string>
<string name="lbl_ok">Οκ</string>
<string name="lbl_cancel">Άκυρο</string>
<string name="welcome_user">User</string>
<string name="menu_home">Αρχική</string>
<string name="demo_sm_flow">Open SM Flow</string>
<string name="demo_sm_map">Open SM Map</string>
<string name="demo_home">Αρχική οθόνη</string>
<string name="demo_all">Όλα</string>
<string name="demo_offer">Προσφορά</string>
<string name="demo_more">Περισσότερα</string>
......
......@@ -5,7 +5,7 @@
</style>
<style name="SDKAppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="android:statusBarColor">@color/cos_grey_light</item>
<item name="android:statusBarColor">@color/custom_grey_light</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
......@@ -23,10 +23,10 @@
</style>
<style name="progressBarGreen" parent="@style/Theme.AppCompat">
<item name="colorAccent">@color/cos_green12</item>
<item name="colorAccent">@color/custom_green12</item>
</style>
<style name="progressBarBlue" parent="@style/Theme.AppCompat">
<item name="colorAccent">@color/cos_light_blue</item>
<item name="colorAccent">@color/custom_light_blue</item>
</style>
</resources>
......