Panagiotis Triantafyllou

my rewards fragment

1 package ly.warp.sdk.activities; 1 package ly.warp.sdk.activities;
2 2
3 +import android.content.Context;
3 import android.os.Bundle; 4 import android.os.Bundle;
4 import android.view.MenuItem; 5 import android.view.MenuItem;
5 import android.widget.Toast; 6 import android.widget.Toast;
...@@ -12,15 +13,14 @@ import com.google.android.material.bottomnavigation.BottomNavigationView; ...@@ -12,15 +13,14 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
12 import com.google.android.material.navigation.NavigationBarView; 13 import com.google.android.material.navigation.NavigationBarView;
13 14
14 import java.util.ArrayList; 15 import java.util.ArrayList;
15 -import java.util.HashMap;
16 16
17 +import io.github.inflationx.viewpump.ViewPumpContextWrapper;
17 import ly.warp.sdk.R; 18 import ly.warp.sdk.R;
18 import ly.warp.sdk.fragments.HomeFragment; 19 import ly.warp.sdk.fragments.HomeFragment;
19 import ly.warp.sdk.fragments.LoyaltyFragment; 20 import ly.warp.sdk.fragments.LoyaltyFragment;
21 +import ly.warp.sdk.fragments.MyRewardsFragment;
20 import ly.warp.sdk.io.callbacks.CallbackReceiver; 22 import ly.warp.sdk.io.callbacks.CallbackReceiver;
21 import ly.warp.sdk.io.models.Campaign; 23 import ly.warp.sdk.io.models.Campaign;
22 -import ly.warp.sdk.io.models.CampaignList;
23 -import ly.warp.sdk.io.models.Consumer;
24 import ly.warp.sdk.io.models.CouponList; 24 import ly.warp.sdk.io.models.CouponList;
25 import ly.warp.sdk.io.models.UnifiedCoupon; 25 import ly.warp.sdk.io.models.UnifiedCoupon;
26 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; 26 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest;
...@@ -89,10 +89,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation ...@@ -89,10 +89,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
89 .addToBackStack(null) 89 .addToBackStack(null)
90 .commit(); 90 .commit();
91 return true; 91 return true;
92 + } else if (itemId == R.id.menu_profile) {
93 + mFragmentToSet = MyRewardsFragment.newInstance();
94 + getSupportFragmentManager().beginTransaction()
95 + .replace(R.id.fl_fragment, mFragmentToSet)
96 + .addToBackStack(null)
97 + .commit();
98 + return true;
92 } 99 }
93 return false; 100 return false;
94 } 101 }
95 102
103 + @Override
104 + public void attachBaseContext(Context newBase) {
105 + super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
106 + }
107 +
96 // =========================================================== 108 // ===========================================================
97 // Methods 109 // Methods
98 // =========================================================== 110 // ===========================================================
......
This diff is collapsed. Click to expand it.