Panagiotis Triantafyllou

minor additions

1 package ly.warp.sdk.activities; 1 package ly.warp.sdk.activities;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 +import android.content.Intent;
4 import android.os.Bundle; 5 import android.os.Bundle;
5 import android.view.View; 6 import android.view.View;
6 import android.widget.AdapterView; 7 import android.widget.AdapterView;
...@@ -98,7 +99,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -98,7 +99,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
98 mRecyclerCoupons.setAdapter(mAdapterCoupons); 99 mRecyclerCoupons.setAdapter(mAdapterCoupons);
99 mAdapterCoupons.getPositionClicks() 100 mAdapterCoupons.getPositionClicks()
100 .doOnNext(coupon -> { 101 .doOnNext(coupon -> {
101 -// startActivity(WarpViewActivity.createIntentFromSessionUUID(this, coupon.getCoupon())); 102 + Intent intent = new Intent(this, CouponInfoActivity.class);
103 + startActivity(intent);
102 }) 104 })
103 .doOnError(error -> { 105 .doOnError(error -> {
104 }) 106 })
......
...@@ -6,6 +6,7 @@ import android.view.LayoutInflater; ...@@ -6,6 +6,7 @@ import android.view.LayoutInflater;
6 import android.view.View; 6 import android.view.View;
7 import android.view.ViewGroup; 7 import android.view.ViewGroup;
8 import android.widget.ImageView; 8 import android.widget.ImageView;
9 +import android.widget.LinearLayout;
9 import android.widget.RelativeLayout; 10 import android.widget.RelativeLayout;
10 import android.widget.TextView; 11 import android.widget.TextView;
11 12
...@@ -17,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -17,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView;
17 import org.json.JSONException; 18 import org.json.JSONException;
18 19
19 import ly.warp.sdk.R; 20 import ly.warp.sdk.R;
21 +import ly.warp.sdk.activities.BillPaymentActivity;
20 import ly.warp.sdk.activities.CouponInfoActivity; 22 import ly.warp.sdk.activities.CouponInfoActivity;
21 import ly.warp.sdk.views.adapters.HomeCampaignAdapter; 23 import ly.warp.sdk.views.adapters.HomeCampaignAdapter;
22 import ly.warp.sdk.views.adapters.HomeCouponAdapter; 24 import ly.warp.sdk.views.adapters.HomeCouponAdapter;
...@@ -26,12 +28,13 @@ import ly.warp.sdk.io.models.CouponList; ...@@ -26,12 +28,13 @@ import ly.warp.sdk.io.models.CouponList;
26 import ly.warp.sdk.io.models.Campaign; 28 import ly.warp.sdk.io.models.Campaign;
27 import ly.warp.sdk.io.models.CampaignList; 29 import ly.warp.sdk.io.models.CampaignList;
28 30
29 -public class HomeFragment extends Fragment { 31 +public class HomeFragment extends Fragment implements View.OnClickListener {
30 32
31 private RelativeLayout mOptionOne, mOptionTwo, mOptionThree; 33 private RelativeLayout mOptionOne, mOptionTwo, mOptionThree;
32 private RecyclerView mRecyclerCampaigns, mRecyclerCoupons; 34 private RecyclerView mRecyclerCampaigns, mRecyclerCoupons;
33 private HomeCouponAdapter mAdapterCoupons; 35 private HomeCouponAdapter mAdapterCoupons;
34 private HomeCampaignAdapter mAdapterCampaigns; 36 private HomeCampaignAdapter mAdapterCampaigns;
37 + private LinearLayout mLlBillPayment;
35 38
36 @Override 39 @Override
37 public View onCreateView( 40 public View onCreateView(
...@@ -44,21 +47,6 @@ public class HomeFragment extends Fragment { ...@@ -44,21 +47,6 @@ public class HomeFragment extends Fragment {
44 public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { 47 public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
45 super.onViewCreated(view, savedInstanceState); 48 super.onViewCreated(view, savedInstanceState);
46 49
47 -// binding.buttonFirst.setOnClickListener(new View.OnClickListener() {
48 -// @Override
49 -// public void onClick(View view) {
50 -// NavHostFragment.findNavController(FirstFragment.this)
51 -// .navigate(R.id.action_FirstFragment_to_SecondFragment);
52 -// }
53 -// });
54 -
55 -// binding.llAdd.setOnClickListener(new View.OnClickListener() {
56 -// @Override
57 -// public void onClick(View view) {
58 -// Log.v("LL ADD", "Clicked");
59 -// }
60 -// });
61 -
62 mOptionOne = (RelativeLayout) view.findViewById(R.id.info_button); 50 mOptionOne = (RelativeLayout) view.findViewById(R.id.info_button);
63 TextView mOptionOneText = (TextView) mOptionOne.findViewById(R.id.option_text); 51 TextView mOptionOneText = (TextView) mOptionOne.findViewById(R.id.option_text);
64 ImageView mOptionOneImage = (ImageView) mOptionOne.findViewById(R.id.option_icon); 52 ImageView mOptionOneImage = (ImageView) mOptionOne.findViewById(R.id.option_icon);
...@@ -77,6 +65,9 @@ public class HomeFragment extends Fragment { ...@@ -77,6 +65,9 @@ public class HomeFragment extends Fragment {
77 mOptionThreeText.setText("1"); 65 mOptionThreeText.setText("1");
78 mOptionThreeImage.setImageResource(R.drawable.tv_option); 66 mOptionThreeImage.setImageResource(R.drawable.tv_option);
79 67
68 + mLlBillPayment = view.findViewById(R.id.ll_bill_payment);
69 + mLlBillPayment.setOnClickListener(this);
70 +
80 /********* TEST CAMPAIGNS DATA **********/ 71 /********* TEST CAMPAIGNS DATA **********/
81 CampaignList clistCampaigns = new CampaignList(); 72 CampaignList clistCampaigns = new CampaignList();
82 try { 73 try {
...@@ -118,11 +109,6 @@ public class HomeFragment extends Fragment { ...@@ -118,11 +109,6 @@ public class HomeFragment extends Fragment {
118 mRecyclerCoupons.setAdapter(mAdapterCoupons); 109 mRecyclerCoupons.setAdapter(mAdapterCoupons);
119 mAdapterCoupons.getPositionClicks() 110 mAdapterCoupons.getPositionClicks()
120 .doOnNext(coupon -> { 111 .doOnNext(coupon -> {
121 -// getContext().startActivity(
122 -// WarpViewActivity.createIntentFromSessionUUID(getContext(),
123 -// coupon.getCoupon()));
124 -
125 -// Intent intent = new Intent(getContext(), BillPaymentActivity.class);
126 Intent intent = new Intent(getContext(), CouponInfoActivity.class); 112 Intent intent = new Intent(getContext(), CouponInfoActivity.class);
127 getContext().startActivity(intent); 113 getContext().startActivity(intent);
128 }) 114 })
...@@ -136,6 +122,14 @@ public class HomeFragment extends Fragment { ...@@ -136,6 +122,14 @@ public class HomeFragment extends Fragment {
136 super.onDestroyView(); 122 super.onDestroyView();
137 } 123 }
138 124
125 + @Override
126 + public void onClick(View view) {
127 + if (view.getId() == R.id.ll_bill_payment) {
128 + Intent intent = new Intent(getContext(), BillPaymentActivity.class);
129 + getContext().startActivity(intent);
130 + }
131 + }
132 +
139 public static Fragment newInstance() { 133 public static Fragment newInstance() {
140 HomeFragment homeFragment = new HomeFragment(); 134 HomeFragment homeFragment = new HomeFragment();
141 return homeFragment; 135 return homeFragment;
......
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
109 android:layout_width="match_parent" 109 android:layout_width="match_parent"
110 android:layout_height="wrap_content" 110 android:layout_height="wrap_content"
111 android:layout_below="@id/rl_home_campaigns"> 111 android:layout_below="@id/rl_home_campaigns">
112 +
112 <androidx.recyclerview.widget.RecyclerView 113 <androidx.recyclerview.widget.RecyclerView
113 android:id="@+id/rv_home_coupons" 114 android:id="@+id/rv_home_coupons"
114 android:layout_width="match_parent" 115 android:layout_width="match_parent"
...@@ -117,7 +118,7 @@ ...@@ -117,7 +118,7 @@
117 android:clipToPadding="false" 118 android:clipToPadding="false"
118 android:orientation="horizontal" 119 android:orientation="horizontal"
119 android:paddingStart="10dp" 120 android:paddingStart="10dp"
120 - android:paddingEnd="10dp"/> 121 + android:paddingEnd="10dp" />
121 </LinearLayout> 122 </LinearLayout>
122 123
123 <androidx.constraintlayout.widget.ConstraintLayout 124 <androidx.constraintlayout.widget.ConstraintLayout
...@@ -159,6 +160,7 @@ ...@@ -159,6 +160,7 @@
159 android:showDividers="middle"> 160 android:showDividers="middle">
160 161
161 <LinearLayout 162 <LinearLayout
163 + android:id="@+id/ll_bill_payment"
162 android:layout_width="150dp" 164 android:layout_width="150dp"
163 android:layout_height="match_parent" 165 android:layout_height="match_parent"
164 android:gravity="center" 166 android:gravity="center"
......