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 14:20:22 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8500c0d97c14f6f973ff05d2609aaeba3aa7fb9f
8500c0d9
1 parent
ac53a7ce
loyalty profile wip3
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
318 additions
and
3 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
warply_android_sdk/src/main/res/drawable-xhdpi/ic_down.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_up.png
warply_android_sdk/src/main/res/drawable/bottom_border_gradient.xml
warply_android_sdk/src/main/res/drawable/bottom_border_transparent.xml
warply_android_sdk/src/main/res/drawable/selector_spinner_arrow.xml
warply_android_sdk/src/main/res/drawable/shape_cos_grey.xml
warply_android_sdk/src/main/res/drawable/shape_cos_sky_blue.xml
warply_android_sdk/src/main/res/layout/activity_loyalty.xml
warply_android_sdk/src/main/res/layout/spinner_dropdown_item_grey.xml
warply_android_sdk/src/main/res/layout/spinner_dropdown_item_sky_blue.xml
warply_android_sdk/src/main/res/layout/spinner_item.xml
warply_android_sdk/src/main/res/layout/tab_analysis.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/src/main/res/values/styles.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
View file @
8500c0d
...
...
@@ -3,7 +3,10 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.ImageView
;
import
android.widget.Spinner
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
...
...
@@ -16,7 +19,8 @@ import ly.warp.sdk.io.models.CouponList;
import
ly.warp.sdk.views.adapters.HomeCouponAdapter
;
public
class
LoyaltyActivity
extends
Activity
implements
View
.
OnClickListener
{
public
class
LoyaltyActivity
extends
Activity
implements
View
.
OnClickListener
,
AdapterView
.
OnItemSelectedListener
{
// ===========================================================
// Constants
...
...
@@ -27,8 +31,9 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
// ===========================================================
private
ImageView
mIvBack
;
private
RecyclerView
mRecyclerCoupons
,
mRecyclerBurntCoupons
;
private
RecyclerView
mRecyclerCoupons
,
mRecyclerBurntCoupons
;
private
HomeCouponAdapter
mAdapterCoupons
,
mAdapterBurntCoupons
;
private
Spinner
mCouponSpinner
,
mRedemptionSpinner
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -43,6 +48,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_loyalty_coupons
);
mRecyclerBurntCoupons
=
findViewById
(
R
.
id
.
rv_loyalty_burnt_coupons
);
mCouponSpinner
=
findViewById
(
R
.
id
.
sp_coupons
);
mRedemptionSpinner
=
findViewById
(
R
.
id
.
sp_redemption
);
initViews
();
}
...
...
@@ -59,6 +66,16 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
}
}
@Override
public
void
onItemSelected
(
AdapterView
<?>
parent
,
View
view
,
int
pos
,
long
id
)
{
// parent.getItemAtPosition(pos)
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
parent
)
{
}
// ===========================================================
// Methods
// ===========================================================
...
...
@@ -90,6 +107,18 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
mRecyclerBurntCoupons
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
HORIZONTAL
,
false
));
mAdapterBurntCoupons
=
new
HomeCouponAdapter
(
this
,
clist
,
true
);
mRecyclerBurntCoupons
.
setAdapter
(
mAdapterBurntCoupons
);
ArrayAdapter
<
CharSequence
>
adapter
=
ArrayAdapter
.
createFromResource
(
this
,
R
.
array
.
coupons_array
,
R
.
layout
.
spinner_item
);
adapter
.
setDropDownViewResource
(
R
.
layout
.
spinner_dropdown_item_grey
);
mCouponSpinner
.
setAdapter
(
adapter
);
mCouponSpinner
.
setOnItemSelectedListener
(
this
);
ArrayAdapter
<
CharSequence
>
adapter2
=
ArrayAdapter
.
createFromResource
(
this
,
R
.
array
.
redemption_array
,
R
.
layout
.
spinner_item
);
adapter2
.
setDropDownViewResource
(
R
.
layout
.
spinner_dropdown_item_sky_blue
);
mRedemptionSpinner
.
setAdapter
(
adapter2
);
mRedemptionSpinner
.
setOnItemSelectedListener
(
this
);
}
// ===========================================================
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/ic_down.png
0 → 100644
View file @
8500c0d
789 Bytes
warply_android_sdk/src/main/res/drawable-xhdpi/ic_up.png
0 → 100644
View file @
8500c0d
744 Bytes
warply_android_sdk/src/main/res/drawable/bottom_border_gradient.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
android:shape=
"rectangle"
>
<gradient
android:angle=
"91"
android:endColor=
"#C4F187"
android:startColor=
"#8EF593"
/>
</shape>
</item>
<item
android:bottom=
"4dp"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"@android:color/white"
/>
</shape>
</item>
</layer-list>
\ No newline at end of file
warply_android_sdk/src/main/res/drawable/bottom_border_transparent.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
android:shape=
"rectangle"
>
<gradient
android:angle=
"91"
android:endColor=
"@android:color/transparent"
android:startColor=
"@android:color/transparent"
/>
</shape>
</item>
<item
android:bottom=
"4dp"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"@android:color/white"
/>
</shape>
</item>
</layer-list>
\ No newline at end of file
warply_android_sdk/src/main/res/drawable/selector_spinner_arrow.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_selected=
"false"
>
<layer-list>
<item>
<shape>
<solid
android:color=
"#F5F5F5"
/>
<corners
android:radius=
"8dp"
/>
<padding
android:left=
"5dp"
android:top=
"5dp"
android:right=
"5dp"
android:bottom=
"5dp"
/>
</shape>
</item>
<item>
<bitmap
android:gravity=
"center_vertical|right"
android:src=
"@drawable/ic_down"
/>
</item>
</layer-list>
</item>
<item
android:state_selected=
"true"
>
<layer-list>
<item>
<shape>
<solid
android:color=
"#F5F5F5"
/>
<corners
android:radius=
"8dp"
/>
</shape>
</item>
<item>
<bitmap
android:gravity=
"center_vertical|right"
android:src=
"@drawable/ic_up"
/>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
warply_android_sdk/src/main/res/drawable/shape_cos_grey.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"11dp"
/>
<solid
android:color=
"#F5F5F5"
/>
</shape>
\ No newline at end of file
warply_android_sdk/src/main/res/drawable/shape_cos_sky_blue.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"11dp"
/>
<solid
android:color=
"#EEF7FF"
/>
</shape>
\ No newline at end of file
warply_android_sdk/src/main/res/layout/activity_loyalty.xml
View file @
8500c0d
...
...
@@ -136,13 +136,76 @@
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_analysis_row"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"40dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/rl_gifts_row"
>
<TextView
android:id=
"@+id/tv_analysis_loyalty_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:text=
"Ανάλυση"
android:textColor=
"@color/grey"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_analysis_loyalty_title"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"24dp"
android:background=
"@drawable/shape_cos_white"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"24dp"
>
<Spinner
android:id=
"@+id/sp_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/shape_cos_grey"
android:dropDownVerticalOffset=
"62dp"
android:popupBackground=
"@drawable/shape_cos_grey"
android:popupElevation=
"1dp"
android:spinnerMode=
"dropdown"
/>
<include
android:id=
"@+id/cl_tab_analysis"
layout=
"@layout/tab_analysis"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/sp_coupons"
android:layout_marginTop=
"32dp"
/>
<Spinner
android:id=
"@+id/sp_redemption"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_below=
"@+id/cl_tab_analysis"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"32dp"
android:background=
"@drawable/shape_cos_sky_blue"
android:dropDownVerticalOffset=
"62dp"
android:popupBackground=
"@drawable/shape_cos_sky_blue"
android:popupElevation=
"1dp"
android:spinnerMode=
"dropdown"
/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_burnt_coupons_row"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/rl_
gift
s_row"
>
app:layout_constraintTop_toBottomOf=
"@+id/rl_
analysi
s_row"
>
<TextView
android:id=
"@+id/tv_burnt_coupons_loyalty_title"
...
...
warply_android_sdk/src/main/res/layout/spinner_dropdown_item_grey.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/layout/simple_spinner_item.xml
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<CheckedTextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:ellipsize=
"marquee"
android:gravity=
"center"
android:singleLine=
"true"
android:textColor=
"#3C3B48"
android:textSize=
"16sp"
tools:text=
"Test Spinner Dropdown"
/>
warply_android_sdk/src/main/res/layout/spinner_dropdown_item_sky_blue.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/layout/simple_spinner_item.xml
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<CheckedTextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:ellipsize=
"marquee"
android:gravity=
"center"
android:singleLine=
"true"
android:textColor=
"#3C3B48"
android:textSize=
"16sp"
tools:text=
"Test Spinner Dropdown"
/>
warply_android_sdk/src/main/res/layout/spinner_item.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"marquee"
android:singleLine=
"true"
android:drawableEnd=
"@drawable/ic_down"
android:paddingHorizontal=
"16dp"
android:textAlignment=
"inherit"
android:textColor=
"#3C3B48"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"Test Spinner"
/>
warply_android_sdk/src/main/res/layout/tab_analysis.xml
0 → 100644
View file @
8500c0d
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tv_month"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bottom_border_gradient"
android:text=
"ΜΗΝΙΑΙΑ"
android:textColor=
"@color/grey"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_six_month"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bottom_border_transparent"
android:text=
"6ΜΗΝΟ"
android:textColor=
"@color/grey"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/tv_twelve_month"
app:layout_constraintStart_toEndOf=
"@+id/tv_month"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_twelve_month"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bottom_border_transparent"
android:text=
"12ΜΗΝΟ"
android:textColor=
"@color/grey"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
warply_android_sdk/src/main/res/values/strings.xml
View file @
8500c0d
...
...
@@ -24,4 +24,14 @@
<string
name=
"cos_questionnaire"
>
Ερωτηματολόγιο
</string>
<string
name=
"cos_gifts_loyalty_title"
>
Τα δώρα μου
</string>
<string
name=
"cos_coupons_loyalty_title"
>
Ενεργά κουπόνια
</string>
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
<item>
Δώρα
</item>
</string-array>
<string-array
name=
"redemption_array"
>
<item>
Εξαργύρωση
</item>
<item>
Επιστροφή
</item>
</string-array>
</resources>
\ No newline at end of file
...
...
warply_android_sdk/src/main/res/values/styles.xml
View file @
8500c0d
...
...
@@ -28,4 +28,8 @@
<item
name=
"android:textSize"
>
14sp
</item>
</style>
<style
name=
"SpinnerTheme"
parent=
"android:Widget.Spinner"
>
<item
name=
"android:background"
>
@drawable/selector_spinner_arrow
</item>
</style>
</resources>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment