Panagiotis Triantafyllou

feedback fixes

......@@ -18,7 +18,6 @@ import androidx.recyclerview.widget.RecyclerView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONObject;
......@@ -140,7 +139,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.ASYNC)
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getRefreshUnifiedCouponsAdded() != null || event.getRefreshVouchersEventModel() != null) {
Handler mUIHandler = new Handler(Looper.getMainLooper());
......
......@@ -563,6 +563,17 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
String tempCoupon = "";
int result = 0;
if (mCoupon.getCoupon().length() == 13) {
tempCoupon = mCoupon.getCoupon();
try {
for (int i = mCoupon.getCoupon().length() - 1; i >= 0; i--) {
result = result + Integer.parseInt(String.valueOf((mCoupon.getCoupon()).charAt(i))) * (1 + (2 * (i % 2)));
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
tempCoupon = mCoupon.getCoupon();
for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) {
......@@ -576,11 +587,13 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
for (int i = mCoupon.getCoupon().length() - 1; i >= 0; i--) {
result = result + Integer.parseInt(String.valueOf((mCoupon.getCoupon()).charAt(i))) * (1 + (2 * (i % 2)));
}
tempCoupon = tempCoupon + (10 - (result % 10)) % 10;
} catch (Exception e) {
e.printStackTrace();
}
}
tempCoupon = tempCoupon + (10 - (result % 10)) % 10;
createBarcodeBitmap(tempCoupon);
}
......
......@@ -272,7 +272,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
String finalMerchantUrl = merchantUrl;
LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_sheet_merchant, null);
LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_sheet_merchant_category, null);
TextView textView = (TextView) v.findViewById(R.id.button_sm_buy_it);
textView.setText(R.string.cos_markets_eshop_item);
......
......@@ -24,7 +24,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button_sm_buy_it"
android:layout_width="150dp"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginEnd="8dp"
android:background="@drawable/selector_button_green2"
......@@ -40,8 +40,10 @@
android:text="@string/cos_sm_buy_it"
android:textColor="@color/white"
android:textSize="14sp"
android:layout_marginStart="24dp"
android:layout_marginEnd="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_sheet_cart"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@android:color/white">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginBottom="32dp"
android:background="@drawable/shape_cos_sheet_item">
<ImageView
android:id="@+id/iv_merchant_sheet_logo"
android:layout_width="140dp"
android:layout_height="36dp"
android:layout_marginStart="24dp"
tools:src="@drawable/cosmote_insurance_logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button_sm_buy_it"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginEnd="8dp"
android:background="@drawable/selector_button_green2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/button_sm_buy_it"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/cos_sm_buy_it"
android:textColor="@color/white"
android:textSize="14sp"
android:layout_marginHorizontal="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file