Panagiotis Triantafyllou

minor addition

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cos1'
PUBLISH_VERSION = '4.5.4-cos2'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -17,6 +17,11 @@ import androidx.recyclerview.widget.RecyclerView;
import java.io.Serializable;
import ly.warp.sdk.R;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyProperty;
import ly.warp.sdk.views.adapters.HomeCouponAdapter;
......@@ -35,7 +40,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons;
private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons;
private Spinner mCouponSpinner, mRedemptionSpinner;
private TextView mTvAnalysisButton, mTvUsername;
private TextView mTvAnalysisButton, mTvUsername, mTvQuestionnaire;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -54,6 +59,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
mRedemptionSpinner = findViewById(R.id.sp_redemption);
mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details);
mTvUsername = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_card_username);
mTvQuestionnaire = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_questionnaire);
initViews();
}
......@@ -72,6 +78,41 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
if (view.getId() == R.id.tv_analysis_details) {
Intent intent = new Intent(this, CouponTransactionActivity.class);
startActivity(intent);
return;
}
if (view.getId() == R.id.tv_questionnaire) {
CampaignList cl = BaseFragmentActivity.getUniqueCampaignList().get("more");
Campaign camp = null;
if (cl != null) {
for (Campaign cn : cl) {
if (cn.getSessionUUID().equals("4fc2865e32bd4d5495a3dfdf1472da7f")) {
camp = cn;
break;
}
}
}
if (camp == null)
return;
String tempUrl = camp.getIndexUrl();
tempUrl = tempUrl
+ "?web_id=" + WarpUtils.getWebId(this)
+ "&app_uuid=" + WarplyProperty.getAppUuid(this)
+ "&api_key=" + WarpUtils.getApiKey(this)
+ "&session_uuid=" + camp.getSessionUUID()
+ "&access_token=" + WarplyDBHelper.getInstance(this).getAuthValue("access_token")
+ "&refresh_token=" + WarplyDBHelper.getInstance(this).getAuthValue("refresh_token")
+ "&client_id=" + WarplyDBHelper.getInstance(this).getClientValue("client_id")
+ "&client_secret=" + WarplyDBHelper.getInstance(this).getClientValue("client_secret");
if (BaseFragmentActivity.getConsumer() != null)
tempUrl = tempUrl + "&auth_token=" + (BaseFragmentActivity.getConsumer().getUuid());
else
tempUrl = tempUrl + "&auth_token=";
startActivity(WarpViewActivity.createIntentFromURL(LoyaltyActivity.this, tempUrl));
}
}
......@@ -101,8 +142,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.GONE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.GONE);
}
} else {
}
}
......@@ -151,6 +190,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue);
mRedemptionSpinner.setAdapter(adapter2);
mRedemptionSpinner.setOnItemSelectedListener(this);
mTvQuestionnaire.setOnClickListener(this);
}
// ===========================================================
......
......@@ -63,6 +63,7 @@
</LinearLayout>
<TextView
android:id="@+id/tv_questionnaire"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
......
......@@ -35,6 +35,5 @@
<string-array name="redemption_array">
<item>Εξαργύρωση</item>
<item>Επιστροφή</item>
</string-array>
</resources>
\ No newline at end of file
......