Showing
4 changed files
with
46 additions
and
5 deletions
| ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
| 2 | 2 | ||
| 3 | ext { | 3 | ext { |
| 4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
| 5 | - PUBLISH_VERSION = '4.5.4-cos1' | 5 | + PUBLISH_VERSION = '4.5.4-cos2' |
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 7 | } | 7 | } |
| 8 | 8 | ... | ... |
| ... | @@ -17,6 +17,11 @@ import androidx.recyclerview.widget.RecyclerView; | ... | @@ -17,6 +17,11 @@ import androidx.recyclerview.widget.RecyclerView; |
| 17 | import java.io.Serializable; | 17 | import java.io.Serializable; |
| 18 | 18 | ||
| 19 | import ly.warp.sdk.R; | 19 | import ly.warp.sdk.R; |
| 20 | +import ly.warp.sdk.db.WarplyDBHelper; | ||
| 21 | +import ly.warp.sdk.io.models.Campaign; | ||
| 22 | +import ly.warp.sdk.io.models.CampaignList; | ||
| 23 | +import ly.warp.sdk.utils.WarpUtils; | ||
| 24 | +import ly.warp.sdk.utils.WarplyProperty; | ||
| 20 | import ly.warp.sdk.views.adapters.HomeCouponAdapter; | 25 | import ly.warp.sdk.views.adapters.HomeCouponAdapter; |
| 21 | 26 | ||
| 22 | 27 | ||
| ... | @@ -35,7 +40,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -35,7 +40,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 35 | private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons; | 40 | private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons; |
| 36 | private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons; | 41 | private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons; |
| 37 | private Spinner mCouponSpinner, mRedemptionSpinner; | 42 | private Spinner mCouponSpinner, mRedemptionSpinner; |
| 38 | - private TextView mTvAnalysisButton, mTvUsername; | 43 | + private TextView mTvAnalysisButton, mTvUsername, mTvQuestionnaire; |
| 39 | 44 | ||
| 40 | // =========================================================== | 45 | // =========================================================== |
| 41 | // Methods for/from SuperClass/Interfaces | 46 | // Methods for/from SuperClass/Interfaces |
| ... | @@ -54,6 +59,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -54,6 +59,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 54 | mRedemptionSpinner = findViewById(R.id.sp_redemption); | 59 | mRedemptionSpinner = findViewById(R.id.sp_redemption); |
| 55 | mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details); | 60 | mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details); |
| 56 | mTvUsername = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_card_username); | 61 | mTvUsername = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_card_username); |
| 62 | + mTvQuestionnaire = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_questionnaire); | ||
| 57 | 63 | ||
| 58 | initViews(); | 64 | initViews(); |
| 59 | } | 65 | } |
| ... | @@ -72,6 +78,41 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -72,6 +78,41 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 72 | if (view.getId() == R.id.tv_analysis_details) { | 78 | if (view.getId() == R.id.tv_analysis_details) { |
| 73 | Intent intent = new Intent(this, CouponTransactionActivity.class); | 79 | Intent intent = new Intent(this, CouponTransactionActivity.class); |
| 74 | startActivity(intent); | 80 | startActivity(intent); |
| 81 | + return; | ||
| 82 | + } | ||
| 83 | + if (view.getId() == R.id.tv_questionnaire) { | ||
| 84 | + CampaignList cl = BaseFragmentActivity.getUniqueCampaignList().get("more"); | ||
| 85 | + Campaign camp = null; | ||
| 86 | + if (cl != null) { | ||
| 87 | + for (Campaign cn : cl) { | ||
| 88 | + if (cn.getSessionUUID().equals("4fc2865e32bd4d5495a3dfdf1472da7f")) { | ||
| 89 | + camp = cn; | ||
| 90 | + break; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + if (camp == null) | ||
| 96 | + return; | ||
| 97 | + | ||
| 98 | + String tempUrl = camp.getIndexUrl(); | ||
| 99 | + | ||
| 100 | + tempUrl = tempUrl | ||
| 101 | + + "?web_id=" + WarpUtils.getWebId(this) | ||
| 102 | + + "&app_uuid=" + WarplyProperty.getAppUuid(this) | ||
| 103 | + + "&api_key=" + WarpUtils.getApiKey(this) | ||
| 104 | + + "&session_uuid=" + camp.getSessionUUID() | ||
| 105 | + + "&access_token=" + WarplyDBHelper.getInstance(this).getAuthValue("access_token") | ||
| 106 | + + "&refresh_token=" + WarplyDBHelper.getInstance(this).getAuthValue("refresh_token") | ||
| 107 | + + "&client_id=" + WarplyDBHelper.getInstance(this).getClientValue("client_id") | ||
| 108 | + + "&client_secret=" + WarplyDBHelper.getInstance(this).getClientValue("client_secret"); | ||
| 109 | + | ||
| 110 | + if (BaseFragmentActivity.getConsumer() != null) | ||
| 111 | + tempUrl = tempUrl + "&auth_token=" + (BaseFragmentActivity.getConsumer().getUuid()); | ||
| 112 | + else | ||
| 113 | + tempUrl = tempUrl + "&auth_token="; | ||
| 114 | + | ||
| 115 | + startActivity(WarpViewActivity.createIntentFromURL(LoyaltyActivity.this, tempUrl)); | ||
| 75 | } | 116 | } |
| 76 | } | 117 | } |
| 77 | 118 | ||
| ... | @@ -101,8 +142,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -101,8 +142,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 101 | findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.GONE); | 142 | findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.GONE); |
| 102 | findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.GONE); | 143 | findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.GONE); |
| 103 | } | 144 | } |
| 104 | - } else { | ||
| 105 | - | ||
| 106 | } | 145 | } |
| 107 | } | 146 | } |
| 108 | 147 | ||
| ... | @@ -151,6 +190,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -151,6 +190,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 151 | adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue); | 190 | adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue); |
| 152 | mRedemptionSpinner.setAdapter(adapter2); | 191 | mRedemptionSpinner.setAdapter(adapter2); |
| 153 | mRedemptionSpinner.setOnItemSelectedListener(this); | 192 | mRedemptionSpinner.setOnItemSelectedListener(this); |
| 193 | + | ||
| 194 | + mTvQuestionnaire.setOnClickListener(this); | ||
| 154 | } | 195 | } |
| 155 | 196 | ||
| 156 | // =========================================================== | 197 | // =========================================================== | ... | ... |
| ... | @@ -63,6 +63,7 @@ | ... | @@ -63,6 +63,7 @@ |
| 63 | </LinearLayout> | 63 | </LinearLayout> |
| 64 | 64 | ||
| 65 | <TextView | 65 | <TextView |
| 66 | + android:id="@+id/tv_questionnaire" | ||
| 66 | android:layout_width="wrap_content" | 67 | android:layout_width="wrap_content" |
| 67 | android:layout_height="wrap_content" | 68 | android:layout_height="wrap_content" |
| 68 | android:layout_marginBottom="4dp" | 69 | android:layout_marginBottom="4dp" | ... | ... |
| ... | @@ -35,6 +35,5 @@ | ... | @@ -35,6 +35,5 @@ |
| 35 | 35 | ||
| 36 | <string-array name="redemption_array"> | 36 | <string-array name="redemption_array"> |
| 37 | <item>Εξαργύρωση</item> | 37 | <item>Εξαργύρωση</item> |
| 38 | - <item>Επιστροφή</item> | ||
| 39 | </string-array> | 38 | </string-array> |
| 40 | </resources> | 39 | </resources> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment