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
2026-03-18 17:18:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3c21f4cec3c433816111767398e75ce0c7302255
3c21f4ce
1 parent
5f9e647c
added filter dialog part2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
8 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetsActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/HomeActivity.java
warply_android_sdk/src/main/res/drawable/shape_rectangle_rounded_white3.xml
warply_android_sdk/src/main/res/layout/dl_filter.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/CouponsetsActivity.java
View file @
3c21f4c
...
...
@@ -27,6 +27,7 @@ public class CouponsetsActivity extends Activity implements View.OnClickListener
// Constants
// ===========================================================
public
static
final
String
EXTRA_CATEGORY
=
"category"
;
public
static
final
String
EXTRA_SUBCATEGORY
=
"subcategory"
;
// ===========================================================
// Fields
...
...
@@ -37,6 +38,7 @@ public class CouponsetsActivity extends Activity implements View.OnClickListener
private
CouponsetAdapter
mCouponsetsAdapter
;
private
TextView
mTvHeaderTitle
,
mTvSearchTitle
;
private
String
mCouponsetsCategory
=
""
;
private
String
mCouponsetsSubcategory
=
""
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -51,6 +53,9 @@ public class CouponsetsActivity extends Activity implements View.OnClickListener
if
(
intent
!=
null
&&
intent
.
hasExtra
(
EXTRA_CATEGORY
))
{
mCouponsetsCategory
=
intent
.
getStringExtra
(
EXTRA_CATEGORY
);
}
if
(
intent
!=
null
&&
intent
.
hasExtra
(
EXTRA_SUBCATEGORY
))
{
mCouponsetsSubcategory
=
intent
.
getStringExtra
(
EXTRA_SUBCATEGORY
);
}
initViews
();
...
...
@@ -81,7 +86,7 @@ public class CouponsetsActivity extends Activity implements View.OnClickListener
mRvCouponsets
=
findViewById
(
R
.
id
.
rv_couponsets
);
mTvHeaderTitle
=
findViewById
(
R
.
id
.
tv_header_title
);
mTvHeaderTitle
.
setText
(
mCouponsetsCategory
);
mTvHeaderTitle
.
setText
(
!
mCouponsetsSubcategory
.
isEmpty
()
?
mCouponsetsSubcategory
:
mCouponsetsCategory
);
mTvSearchTitle
=
findViewById
(
R
.
id
.
tv_search_title
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
ping_lcg_bold
,
mTvHeaderTitle
);
...
...
@@ -97,6 +102,17 @@ public class CouponsetsActivity extends Activity implements View.OnClickListener
ArrayList
<
Couponset
>
couponsets
=
categorizedMap
.
get
(
mCouponsetsCategory
);
if
(
couponsets
==
null
||
couponsets
.
isEmpty
())
return
;
if
(!
mCouponsetsSubcategory
.
isEmpty
())
{
ArrayList
<
Couponset
>
filtered
=
new
ArrayList
<>();
for
(
Couponset
c
:
couponsets
)
{
if
(
mCouponsetsSubcategory
.
equals
(
c
.
getOfferCategory
()))
{
filtered
.
add
(
c
);
}
}
couponsets
=
filtered
;
}
if
(
couponsets
.
isEmpty
())
return
;
GridLayoutManager
layoutManager
=
new
GridLayoutManager
(
this
,
2
);
mRvCouponsets
.
setLayoutManager
(
layoutManager
);
mRvCouponsets
.
setHasFixedSize
(
true
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/HomeActivity.java
View file @
3c21f4c
...
...
@@ -376,15 +376,25 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
LinearLayout
llFilterContainer
=
dialogView
.
findViewById
(
R
.
id
.
ll_filter_container
);
LinearLayout
llFilterHeader
=
dialogView
.
findViewById
(
R
.
id
.
header_layout
);
TextView
headerTitle
=
llFilterHeader
.
findViewById
(
R
.
id
.
tv_header_title
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
ping_lcg_bold
,
headerTitle
);
ImageView
headerClose
=
llFilterHeader
.
findViewById
(
R
.
id
.
dlg_close_icon
);
headerClose
.
setOnClickListener
(
v
->
{
bottomSheetDialog
.
dismiss
();
});
// Static "Top Offers" row
View
topOffersRow
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
item_filter_category
,
llFilterContainer
,
false
);
TextView
tvTopOffers
=
topOffersRow
.
findViewById
(
R
.
id
.
tv_category_name
);
tvTopOffers
.
setText
(
getString
(
R
.
string
.
lbl_top_offers
));
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
ping_lcg_regular
,
tvTopOffers
);
topOffersRow
.
setTag
(
R
.
string
.
lbl_top_offers
);
topOffersRow
.
setTag
(
getString
(
R
.
string
.
lbl_top_offers
)
);
topOffersRow
.
setOnClickListener
(
v
->
{
// TODO: filter action
bottomSheetDialog
.
dismiss
();
Intent
filterIntent
=
new
Intent
(
HomeActivity
.
this
,
CouponsetsActivity
.
class
);
filterIntent
.
putExtra
(
CouponsetsActivity
.
EXTRA_CATEGORY
,
(
String
)
v
.
getTag
());
startActivity
(
filterIntent
);
});
llFilterContainer
.
addView
(
topOffersRow
);
...
...
@@ -417,8 +427,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
ivArrow
.
setVisibility
(
View
.
GONE
);
categoryRow
.
setTag
(
parent
.
getAdminName
());
categoryRow
.
setOnClickListener
(
v
->
{
// TODO: filter action
bottomSheetDialog
.
dismiss
();
Intent
filterIntent
=
new
Intent
(
HomeActivity
.
this
,
CouponsetsActivity
.
class
);
filterIntent
.
putExtra
(
CouponsetsActivity
.
EXTRA_CATEGORY
,
(
String
)
v
.
getTag
());
startActivity
(
filterIntent
);
});
llFilterContainer
.
addView
(
categoryRow
);
}
else
{
...
...
@@ -440,8 +452,11 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
ping_lcg_regular
,
tvSubcategoryName
);
childRow
.
setTag
(
child
.
getAdminName
());
childRow
.
setOnClickListener
(
v
->
{
// TODO: filter action
bottomSheetDialog
.
dismiss
();
Intent
filterIntent
=
new
Intent
(
HomeActivity
.
this
,
CouponsetsActivity
.
class
);
filterIntent
.
putExtra
(
CouponsetsActivity
.
EXTRA_CATEGORY
,
parent
.
getAdminName
());
filterIntent
.
putExtra
(
CouponsetsActivity
.
EXTRA_SUBCATEGORY
,
(
String
)
v
.
getTag
());
startActivity
(
filterIntent
);
});
childContainer
.
addView
(
childRow
);
}
...
...
warply_android_sdk/src/main/res/drawable/shape_rectangle_rounded_white3.xml
0 → 100644
View file @
3c21f4c
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"1000dp"
/>
<solid
android:width=
"2dp"
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
warply_android_sdk/src/main/res/layout/dl_filter.xml
View file @
3c21f4c
...
...
@@ -5,6 +5,41 @@
android:background=
"@color/custom_black7"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/header_layout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/custom_black7"
android:gravity=
"center"
android:orientation=
"horizontal"
android:paddingVertical=
"16dp"
android:paddingHorizontal=
"16dp"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_header_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:text=
"@string/demo_search_title"
android:textColor=
"@color/white"
android:textSize=
"28sp"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/dlg_close_icon"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:background=
"@drawable/shape_rectangle_rounded_white3"
android:padding=
"16dp"
android:src=
"@drawable/demo_close"
/>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
3c21f4c
...
...
@@ -42,5 +42,5 @@
<string
name=
"demo_partners_title"
>
Partner businesses
</string>
<string
name=
"demo_search_title"
>
Αναζήτηση
</string>
<string
name=
"lbl_directions"
>
Οδηγίες
</string>
<string
name=
"lbl_top_offers"
>
Top
O
ffers
</string>
<string
name=
"lbl_top_offers"
>
Top
o
ffers
</string>
</resources>
...
...
warply_android_sdk/src/main/res/values/styles.xml
View file @
3c21f4c
...
...
@@ -50,8 +50,6 @@
<style
name=
"FullScreenBottomSheetDialog"
parent=
"Theme.MaterialComponents.Light.BottomSheetDialog"
>
<item
name=
"android:windowIsFloating"
>
false
</item>
<item
name=
"android:windowFullscreen"
>
true
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"bottomSheetStyle"
>
@style/FullScreenBottomSheetStyle
</item>
</style>
...
...
Please
register
or
login
to post a comment