Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta76'
PUBLISH_VERSION = '4.5.4-cosbeta77'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -24,6 +24,10 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
......@@ -188,9 +192,24 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mValuesList
);
runOnUiThread(() -> {
runOnUiThread(this::initViews2);
}
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mIvBack.setOnClickListener(this);
mIvPopupClose.setOnClickListener(this);
// if (WarpUtils.getGiftsPopup(this))
// mLlGiftsPopup.setVisibility(View.VISIBLE);
if (mData != null && mData.size() > 0) {
mAdapterMergedGifts = new MergedGiftsAdapter(GiftsForYouActivity.this, mData);
mRecyclerMergedGifts.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterMergedGifts = new MergedGiftsAdapter(this, mData);
mRecyclerMergedGifts.setAdapter(mAdapterMergedGifts);
mAdapterMergedGifts.getPositionClicks()
.doOnNext(dataItem -> {
......@@ -282,7 +301,6 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(dataItem.getCampaign().getSessionUUID())) {
WarpUtils.log("CCMS_CLICK " + ccms.toString());
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(dataItem.getCampaign(), ccms)), 1004);
break;
}
......@@ -312,24 +330,14 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
.subscribe();
mAdapterMergedGifts.notifyDataSetChanged();
}
});
}
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
private void initViews2() {
mIvBack.setOnClickListener(this);
mIvPopupClose.setOnClickListener(this);
// if (WarpUtils.getGiftsPopup(this))
// mLlGiftsPopup.setVisibility(View.VISIBLE);
if (mData != null && mData.size() > 0) {
mRecyclerMergedGifts.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterMergedGifts = new MergedGiftsAdapter(this, mData);
mAdapterMergedGifts = new MergedGiftsAdapter(GiftsForYouActivity.this, mData);
mRecyclerMergedGifts.setAdapter(mAdapterMergedGifts);
mAdapterMergedGifts.getPositionClicks()
.doOnNext(dataItem -> {
......@@ -421,6 +429,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(dataItem.getCampaign().getSessionUUID())) {
WarpUtils.log("CCMS_CLICK " + ccms.toString());
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(dataItem.getCampaign(), ccms)), 1004);
break;
}
......@@ -448,6 +457,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
.doOnError(error -> {
})
.subscribe();
mAdapterMergedGifts.notifyDataSetChanged();
}
}
......@@ -488,6 +498,10 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mData.add(data);
}
}
Set<MergedGifts> set = new LinkedHashSet<>(mData);
mData.clear();
mData.addAll(set);
}
private void filterItems() {
......
......@@ -38,6 +38,7 @@ import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.MergedMoreAdapter;
import ly.warp.sdk.views.adapters.MoreCampaignAdapter;
import ly.warp.sdk.views.adapters.MoreContextualAdapter;
......@@ -211,7 +212,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
// initViews2();
/** New Implementation */
initViewsNew2();
runOnUiThread(this::initViewsNew2);
/** New Implementation */
}
}
......@@ -518,10 +519,11 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
if (extraFields.has("type") && extraFields.optString("type").equals("telco")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(moreItem.getSessionUUID())) {
WarplyManager.getSingleCampaign(moreItem.getSessionUUID());
Intent intent = new Intent(MoreForYouActivity.this, TelcoActivity.class);
intent.putExtra("ccms", ccms);
intent.putExtra("loyalty", (Serializable) moreItem);
startActivity(intent);
startActivityForResult(intent, 1003);
break;
}
}
......
......@@ -25,6 +25,7 @@
package ly.warp.sdk.utils;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
......@@ -79,6 +80,7 @@ import ly.warp.sdk.io.request.WarplyIntegrationRequest;
import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import ly.warp.sdk.services.EventService;
import ly.warp.sdk.services.FCMBaseMessagingService;
import ly.warp.sdk.services.WarplyHealthService;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -1230,6 +1232,23 @@ public class WarplyManagerHelper {
}
public static void logoutUser() {
if (isMyServiceRunning(WarplyHealthService.class)) {
Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
Warply.getWarplyContext().stopService(stepsServiceIntent);
}
}
private static boolean isMyServiceRunning(Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) Warply.getWarplyContext().getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
......
......@@ -532,7 +532,7 @@ public class WarpView extends WebView {
WarplyManagerHelper.mMetersWebview = 0.0d;
WarpViewActivity.getMetersHandler().postDelayed(this, 300);
}
}, 1000);
}, 3000); //TODO: change it back to 1000
if (url.contains("about:blank")) {
WarpView.this.clearHistory();
......
......@@ -10,24 +10,24 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_coupons_close"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/cos_active_all_coupons"
android:textColor="@color/grey"
......
......@@ -10,23 +10,24 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_list_close"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:scaleType="centerInside"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView3" />
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/grey"
android:textSize="17sp"
......@@ -34,8 +35,7 @@
android:text="@string/cos_active_gifts_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.356"
app:layout_constraintStart_toEndOf="@+id/iv_list_close"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_contextual_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_coupon_info_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_coupon_share_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_couponset_info_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -11,23 +11,24 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_list_close"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:scaleType="centerInside"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView3" />
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/grey"
android:textSize="17sp"
......@@ -35,8 +36,7 @@
android:text="@string/cos_gifts_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.356"
app:layout_constraintStart_toEndOf="@+id/iv_list_close"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -10,15 +10,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_analysis_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_loyalty_analysis_close"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -10,32 +10,32 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_more_header"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_height="48dp"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_list_close"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:scaleType="centerInside"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView3" />
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="206dp"
android:layout_height="32dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/cos_more_title"
android:textColor="@color/grey"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.356"
app:layout_constraintStart_toEndOf="@+id/iv_list_close"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_shops_back"
android:layout_width="26dp"
android:layout_height="25dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_back"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -8,15 +8,16 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="48dp"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_telco_back"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_close"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......