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
thkouk00
2022-03-29 17:38:52 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
338e1392957c6c633395dbecf5641d51bf750796
338e1392
1 parent
7904f618
conditional rendering in loyalty dropdowns
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
186 additions
and
1 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
warply_android_sdk/src/main/res/drawable-xhdpi/deals_for_you.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_bag.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_chart2.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_food.png
warply_android_sdk/src/main/res/layout/cos_analysis.xml
warply_android_sdk/src/main/res/layout/cos_piechart.xml
warply_android_sdk/src/main/res/layout/cos_piechart2.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
View file @
338e139
...
...
@@ -2,6 +2,7 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.media.Image
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.AdapterView
;
...
...
@@ -77,6 +78,34 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
@Override
public
void
onItemSelected
(
AdapterView
<?>
parent
,
View
view
,
int
pos
,
long
id
)
{
// parent.getItemAtPosition(pos)
ImageView
chartImg
=
findViewById
(
R
.
id
.
cl_chart
).
findViewById
(
R
.
id
.
iv_chart
);
ImageView
innerChartImg
=
findViewById
(
R
.
id
.
cl_chart
).
findViewById
(
R
.
id
.
iv_inner_chart
);
if
(
parent
.
getId
()
==
mCouponSpinner
.
getId
())
{
if
(
pos
==
1
)
{
mRedemptionSpinner
.
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_tab_analysis
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_chart
).
setVisibility
(
View
.
GONE
);
// findViewById(R.id.cl_chart2).setVisibility(View.VISIBLE);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab2
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab3
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab4
).
setVisibility
(
View
.
VISIBLE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab5
).
setVisibility
(
View
.
VISIBLE
);
}
else
{
mRedemptionSpinner
.
setVisibility
(
View
.
VISIBLE
);
findViewById
(
R
.
id
.
cl_chart
).
setVisibility
(
View
.
VISIBLE
);
// findViewById(R.id.cl_chart2).setVisibility(View.GONE);
findViewById
(
R
.
id
.
cl_tab_analysis
).
setVisibility
(
View
.
VISIBLE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab
).
setVisibility
(
View
.
VISIBLE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab2
).
setVisibility
(
View
.
VISIBLE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab3
).
setVisibility
(
View
.
VISIBLE
);
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
{
}
}
@Override
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/deals_for_you.png
0 → 100644
View file @
338e139
33.6 KB
warply_android_sdk/src/main/res/drawable-xhdpi/ic_bag.png
0 → 100644
View file @
338e139
950 Bytes
warply_android_sdk/src/main/res/drawable-xhdpi/ic_chart2.png
0 → 100644
View file @
338e139
15.1 KB
warply_android_sdk/src/main/res/drawable-xhdpi/ic_food.png
0 → 100644
View file @
338e139
1.28 KB
warply_android_sdk/src/main/res/layout/cos_analysis.xml
View file @
338e139
...
...
@@ -6,6 +6,7 @@
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/analysis_tab"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -43,6 +44,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/analysis_tab2"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"20dp"
>
...
...
@@ -81,6 +83,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/analysis_tab3"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -117,6 +120,84 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/analysis_tab4"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"20dp"
>
<ImageView
android:id=
"@+id/iv_chart_icon4"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:src=
"@drawable/ic_food"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:text=
"Γεύση"
android:textColor=
"#4D4C58"
android:textSize=
"15sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_chart_icon4"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"77%"
android:textColor=
"#00CB09"
android:textSize=
"17sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/analysis_tab5"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"20dp"
>
<ImageView
android:id=
"@+id/iv_chart_icon5"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:src=
"@drawable/ic_bag"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:text=
"Shopping"
android:textColor=
"#4D4C58"
android:textSize=
"15sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_chart_icon5"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"23%"
android:textColor=
"#0072C9"
android:textSize=
"17sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id=
"@+id/tv_analysis_details"
android:layout_width=
"match_parent"
...
...
warply_android_sdk/src/main/res/layout/cos_piechart.xml
View file @
338e139
...
...
@@ -29,6 +29,7 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_inner_chart"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_cosmote_logo"
...
...
warply_android_sdk/src/main/res/layout/cos_piechart2.xml
0 → 100644
View file @
338e139
<?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"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"200dp"
android:layout_height=
"200dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_vertical_15_guideline"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.15"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_vertical_85_guideline"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.85"
/>
<ImageView
android:id=
"@+id/iv_chart"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:src=
"@drawable/ic_chart2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_inner_chart"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/deals_for_you"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/gl_vertical_85_guideline"
app:layout_constraintStart_toEndOf=
"@+id/gl_vertical_15_guideline"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.308"
/>
<TextView
android:id=
"@+id/textView4"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"60dp"
android:layout_marginTop=
"12dp"
android:gravity=
"center"
android:text=
"έχεις κερδίσει"
android:textColor=
"#4D4C58"
android:textSize=
"12dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"@+id/iv_chart"
app:layout_constraintTop_toBottomOf=
"@+id/iv_inner_chart"
/>
<TextView
android:id=
"@+id/textView8"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:gravity=
"center"
android:text=
"12,00€"
android:textColor=
"#4D4C58"
android:textSize=
"18dp"
android:textFontWeight=
"1000"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"@+id/iv_chart"
app:layout_constraintHorizontal_bias=
"0.503"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/textView4"
app:layout_constraintVertical_bias=
"0.0"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
warply_android_sdk/src/main/res/values/strings.xml
View file @
338e139
...
...
@@ -29,7 +29,7 @@
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
<item>
Δώρα
</item>
<item>
Deals for you
</item>
</string-array>
<string-array
name=
"redemption_array"
>
...
...
Please
register
or
login
to post a comment