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-30 14:25:57 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
006ff92c628ba0319877519d4ef3eb7c1648da21
006ff92c
1 parent
1dc96fa1
dl gift
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
6 deletions
keystore/warplydemo.jks
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
warply_android_sdk/src/main/res/layout/dl_dialog.xml
warply_android_sdk/src/main/res/values/strings.xml
keystore/warplydemo.jks
deleted
100644 → 0
View file @
1dc96fa
No preview for this file type
warply_android_sdk/src/main/AndroidManifest.xml
View file @
006ff92
...
...
@@ -55,8 +55,19 @@
<activity
android:name=
"ly.warp.sdk.activities.BaseFragmentActivity"
android:exported=
"false"
android:screenOrientation=
"portrait"
/>
android:exported=
"true"
android:screenOrientation=
"portrait"
>
<intent-filter
android:autoVerify=
"true"
>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:host=
"cosmoteapp.gr"
android:scheme=
"demo"
/>
</intent-filter>
</activity>
<!-- Service used for updating user's location. -->
<service
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
006ff92
package
ly
.
warp
.
sdk
.
activities
;
import
android.app.Dialog
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.view.MenuItem
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.fragment.app.Fragment
;
...
...
@@ -12,12 +17,11 @@ import androidx.fragment.app.FragmentActivity;
import
com.google.android.material.bottomnavigation.BottomNavigationView
;
import
com.google.android.material.navigation.NavigationBarView
;
import
org.json.JSONException
;
import
java.util.HashMap
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.fragments.HomeFragment
;
import
ly.warp.sdk.fragments.LoyaltyFragment
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
...
...
@@ -32,6 +36,7 @@ import ly.warp.sdk.io.request.WarplyConsumerRequest;
import
ly.warp.sdk.io.request.WarplyGetCouponsetsRequest
;
import
ly.warp.sdk.io.request.WarplyInboxRequest
;
import
ly.warp.sdk.io.request.WarplyUserCouponsRequest
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyProperty
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
import
ly.warp.sdk.utils.managers.WarplySessionManager
;
...
...
@@ -49,7 +54,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
private
BottomNavigationView
mBottomNavigationView
;
private
Fragment
mFragmentToSet
=
null
;
private
static
Consumer
mConsumer
;
private
static
HashMap
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
private
static
HashMap
<
String
,
CampaignList
>
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
private
static
CouponList
mCouponList
=
new
CouponList
();
private
CouponsetsList
mCouponsetsList
;
...
...
@@ -114,6 +119,54 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
// Methods
// ===========================================================
private
void
handleIntent
(
Intent
intent
)
{
Uri
data
=
intent
.
getData
();
if
(
data
!=
null
)
{
if
(
intent
.
getData
().
getQueryParameterNames
().
size
()
>
0
&&
intent
.
getData
().
getQueryParameterNames
().
contains
(
"participations"
))
{
String
parameter
=
String
.
valueOf
(
intent
.
getData
().
getQueryParameter
(
"participations"
));
showDialog
(
parameter
);
}
}
}
private
void
showDialog
(
String
parameter
)
{
Dialog
dialog
=
new
Dialog
(
this
,
R
.
style
.
PopUpDialog
);
dialog
.
setContentView
(
R
.
layout
.
dl_dialog
);
dialog
.
getWindow
().
setBackgroundDrawableResource
(
R
.
drawable
.
banner_border_white
);
dialog
.
show
();
TextView
mTvDlTitle
=
dialog
.
findViewById
(
R
.
id
.
tv_dl_subtitle
);
LinearLayout
mLlRedeem
=
dialog
.
findViewById
(
R
.
id
.
ll_dl_redeem
);
mTvDlTitle
.
setText
(
String
.
format
(
getResources
().
getString
(
R
.
string
.
cos_dl_title
),
parameter
));
mLlRedeem
.
setOnClickListener
(
view
->
{
if
(
mUniqueCampaignList
!=
null
&&
!
mUniqueCampaignList
.
isEmpty
())
{
if
(
mUniqueCampaignList
.
containsKey
(
"lucky_draw"
)
&&
mUniqueCampaignList
.
get
(
"lucky_draw"
).
size
()
>
0
)
{
String
tempUrl
=
mUniqueCampaignList
.
get
(
"lucky_draw"
).
get
(
0
).
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
this
)
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
this
)
+
"&api_key="
+
WarpUtils
.
getApiKey
(
this
)
+
"&session_uuid="
+
mUniqueCampaignList
.
get
(
"lucky_draw"
).
get
(
0
).
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
(
mConsumer
!=
null
)
tempUrl
=
tempUrl
+
"&auth_token="
+
(
mConsumer
.
getUuid
());
else
tempUrl
=
tempUrl
+
"&auth_token="
;
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
this
,
tempUrl
));
dialog
.
dismiss
();
}
}
});
}
public
static
Consumer
getConsumer
()
{
return
mConsumer
;
}
...
...
@@ -127,6 +180,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
private
void
initViews
()
{
handleIntent
(
getIntent
());
mBottomNavigationView
.
setOnItemSelectedListener
(
this
);
mFragmentToSet
=
HomeFragment
.
newInstance
();
getSupportFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
fl_fragment
,
mFragmentToSet
).
commit
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
View file @
006ff92
...
...
@@ -119,7 +119,6 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
}
}
});
}
// ===========================================================
// Inner and Anonymous Classes
...
...
warply_android_sdk/src/main/res/layout/dl_dialog.xml
0 → 100644
View file @
006ff92
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"56dp"
>
<TextView
android:id=
"@+id/tv_dl_title"
android:layout_width=
"match_parent"
android:layout_height=
"55dp"
android:layout_alignParentStart=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginHorizontal=
"48dp"
android:gravity=
"center"
android:text=
"Έλαβες δώρο!"
android:textColor=
"#0072C9"
android:textSize=
"25sp"
android:textStyle=
"bold"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_dl_subtitle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_dl_title"
android:layout_alignParentStart=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginHorizontal=
"48dp"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"24dp"
android:gravity=
"center"
android:textColor=
"#5B5B5B"
android:textFontWeight=
"500"
android:textSize=
"18sp"
tools:text=
"@string/cos_dl_title"
/>
<LinearLayout
android:id=
"@+id/ll_dl_redeem"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_below=
"@+id/tv_dl_subtitle"
android:layout_marginHorizontal=
"32dp"
android:layout_marginTop=
"24dp"
android:background=
"@drawable/shape_cos_gradient2"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"Εξαργύρωσε τώρα!"
android:textColor=
"@color/white"
android:textSize=
"17dp"
android:textStyle=
"bold"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
warply_android_sdk/src/main/res/values/strings.xml
View file @
006ff92
...
...
@@ -26,6 +26,7 @@
<string
name=
"cos_coupons_loyalty_title"
>
Ενεργά κουπόνια
</string>
<string
name=
"cos_coupon_info_title"
>
Εκπτωτικό κουπόνι
</string>
<string
name=
"cos_coupon_date"
>
Το κουπόνι ισχύει έως %1$s
</string>
<string
name=
"cos_dl_title"
>
Μόλις έλαβες δώρο %1$s συμμετοχές στο My Lucky Day Draw!
</string>
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
...
...
Please
register
or
login
to post a comment