Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-03-24 16:58:15 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fe1fe71e68714803b58952acb790b9a9ab9d745e
fe1fe71e
1 parent
76dba696
minor additions
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/res/layout/fragment_home.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
View file @
fe1fe71
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
->
{
})
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
fe1fe71
...
...
@@ -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
;
...
...
warply_android_sdk/src/main/res/layout/fragment_home.xml
View file @
fe1fe71
...
...
@@ -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"
...
...
Please
register
or
login
to post a comment