Panagiotis Triantafyllou

minor additions

package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
......@@ -98,7 +99,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
// startActivity(WarpViewActivity.createIntentFromSessionUUID(this, coupon.getCoupon()));
Intent intent = new Intent(this, CouponInfoActivity.class);
startActivity(intent);
})
.doOnError(error -> {
})
......
......@@ -6,6 +6,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
......@@ -17,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView;
import org.json.JSONException;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.BillPaymentActivity;
import ly.warp.sdk.activities.CouponInfoActivity;
import ly.warp.sdk.views.adapters.HomeCampaignAdapter;
import ly.warp.sdk.views.adapters.HomeCouponAdapter;
......@@ -26,12 +28,13 @@ import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
public class HomeFragment extends Fragment {
public class HomeFragment extends Fragment implements View.OnClickListener {
private RelativeLayout mOptionOne, mOptionTwo, mOptionThree;
private RecyclerView mRecyclerCampaigns, mRecyclerCoupons;
private HomeCouponAdapter mAdapterCoupons;
private HomeCampaignAdapter mAdapterCampaigns;
private LinearLayout mLlBillPayment;
@Override
public View onCreateView(
......@@ -44,21 +47,6 @@ public class HomeFragment extends Fragment {
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// binding.buttonFirst.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// NavHostFragment.findNavController(FirstFragment.this)
// .navigate(R.id.action_FirstFragment_to_SecondFragment);
// }
// });
// binding.llAdd.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Log.v("LL ADD", "Clicked");
// }
// });
mOptionOne = (RelativeLayout) view.findViewById(R.id.info_button);
TextView mOptionOneText = (TextView) mOptionOne.findViewById(R.id.option_text);
ImageView mOptionOneImage = (ImageView) mOptionOne.findViewById(R.id.option_icon);
......@@ -77,6 +65,9 @@ public class HomeFragment extends Fragment {
mOptionThreeText.setText("1");
mOptionThreeImage.setImageResource(R.drawable.tv_option);
mLlBillPayment = view.findViewById(R.id.ll_bill_payment);
mLlBillPayment.setOnClickListener(this);
/********* TEST CAMPAIGNS DATA **********/
CampaignList clistCampaigns = new CampaignList();
try {
......@@ -118,11 +109,6 @@ public class HomeFragment extends Fragment {
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
// getContext().startActivity(
// WarpViewActivity.createIntentFromSessionUUID(getContext(),
// coupon.getCoupon()));
// Intent intent = new Intent(getContext(), BillPaymentActivity.class);
Intent intent = new Intent(getContext(), CouponInfoActivity.class);
getContext().startActivity(intent);
})
......@@ -136,6 +122,14 @@ public class HomeFragment extends Fragment {
super.onDestroyView();
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.ll_bill_payment) {
Intent intent = new Intent(getContext(), BillPaymentActivity.class);
getContext().startActivity(intent);
}
}
public static Fragment newInstance() {
HomeFragment homeFragment = new HomeFragment();
return homeFragment;
......
......@@ -109,6 +109,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl_home_campaigns">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_home_coupons"
android:layout_width="match_parent"
......@@ -117,7 +118,7 @@
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp"/>
android:paddingEnd="10dp" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -159,6 +160,7 @@
android:showDividers="middle">
<LinearLayout
android:id="@+id/ll_bill_payment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:gravity="center"
......