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
2023-06-27 17:27:42 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ec14fc95acd60b904676240e22fa1ce8d82abc27
ec14fc95
1 parent
bce1f027
telematics
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
223 additions
and
28 deletions
.idea/deploymentTargetDropDown.xml
app/src/main/AndroidManifest.xml
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelematicsActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/res/layout/activity_telematics.xml
warply_android_sdk/src/main/res/layout/fragment_home.xml
warply_android_sdk/src/main/res/values/strings.xml
.idea/deploymentTargetDropDown.xml
0 → 100644
View file @
ec14fc9
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"deploymentTargetDropDown"
>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type
value=
"RUNNING_DEVICE_TARGET"
/>
<deviceKey>
<Key>
<type
value=
"SERIAL_NUMBER"
/>
<value
value=
"R58M5262DCB"
/>
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2023-06-27T13:21:52.853768900Z"
/>
</component>
</project>
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
ec14fc9
...
...
@@ -3,6 +3,7 @@
package=
"warp.ly.android_sdk"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<!-- Restrict Tablets -->
<!-- <supports-screens-->
...
...
@@ -23,6 +24,7 @@
android:label=
"@string/app_name"
android:largeHeap=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:requestLegacyExternalStorage=
"true"
android:theme=
"@style/AppTheme"
>
<meta-data
android:name=
"com.google.android.geo.API_KEY"
...
...
warply_android_sdk/src/main/AndroidManifest.xml
View file @
ec14fc9
...
...
@@ -66,6 +66,12 @@
android:theme=
"@style/SDKAppTheme"
/>
<activity
android:name=
"ly.warp.sdk.activities.TelematicsActivity"
android:exported=
"false"
android:screenOrientation=
"portrait"
android:theme=
"@style/SDKAppTheme"
/>
<activity
android:name=
"ly.warp.sdk.activities.GiftsForYouActivity"
android:exported=
"false"
android:screenOrientation=
"portrait"
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelematicsActivity.java
0 → 100644
View file @
ec14fc9
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
ec14fc9
...
...
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.activities.ActiveCouponsActivity
;
import
ly.warp.sdk.activities.TelematicsActivity
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.models.Campaign
;
...
...
@@ -33,9 +34,7 @@ import ly.warp.sdk.views.adapters.HomeCampaignAdapter;
public
class
HomeFragment
extends
Fragment
implements
View
.
OnClickListener
,
SwipeRefreshLayout
.
OnRefreshListener
{
private
RelativeLayout
mOptionOne
,
mOptionTwo
,
mOptionThree
;
private
RecyclerView
mRecyclerCampaigns
;
private
HomeCampaignAdapter
mAdapterCampaigns
;
private
RelativeLayout
mOptionOne
,
mOptionTwo
,
mOptionThree
,
mRlDriving
;
private
LinearLayout
mLlBillPayment
;
private
TextView
mTvUsername
,
mTvActiveCoupons
;
private
ConstraintLayout
mClActiveCoupons
;
...
...
@@ -86,17 +85,8 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
mTvUsername
.
setText
(
String
.
format
(
getResources
().
getString
(
R
.
string
.
welcome_user
),
WarplyManagerHelper
.
getConsumer
().
getFirstName
()
+
" "
+
WarplyManagerHelper
.
getConsumer
().
getLastName
()));
mRecyclerCampaigns
=
view
.
findViewById
(
R
.
id
.
rv_home_campaigns
);
mRecyclerCampaigns
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
HORIZONTAL
,
false
));
mAdapterCampaigns
=
new
HomeCampaignAdapter
(
getContext
(),
WarplyManagerHelper
.
getUniqueCampaignList
().
get
(
"homescreen"
));
mRecyclerCampaigns
.
setAdapter
(
mAdapterCampaigns
);
mAdapterCampaigns
.
getPositionClicks
()
.
doOnNext
(
campaign
->
{
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
getContext
(),
WarplyManagerHelper
.
constructCampaignUrl
(
campaign
)));
})
.
doOnError
(
error
->
{
})
.
subscribe
();
mRlDriving
=
view
.
findViewById
(
R
.
id
.
rl_driving
);
mRlDriving
.
setOnClickListener
(
this
);
}
@Override
...
...
@@ -117,6 +107,11 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
Intent
intent
=
new
Intent
(
getContext
(),
ActiveCouponsActivity
.
class
);
intent
.
putExtra
(
"couponlist"
,
WarplyManagerHelper
.
getCouponList
());
startActivity
(
intent
);
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
rl_driving
)
{
Intent
intent
=
new
Intent
(
getContext
(),
TelematicsActivity
.
class
);
startActivity
(
intent
);
}
}
...
...
warply_android_sdk/src/main/res/layout/activity_telematics.xml
0 → 100644
View file @
ec14fc9
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/ll_telematics_main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_light_grey3"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_bill_header"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_telematics_close"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_marginStart=
"16dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/ic_back"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/textView3"
fontPath=
"fonts/BTCosmo-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"@string/cos_telematics"
android:textColor=
"@color/cos_light_black"
android:textSize=
"19sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_light_grey3"
android:gravity=
"center_horizontal"
>
<TextView
android:id=
"@+id/tv_sensor_data_label"
fontPath=
"fonts/PeridotPE-Regular.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:text=
"Sensor Data"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_sensor_data"
fontPath=
"fonts/PeridotPE-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_sensor_data_label"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_velocity_label"
fontPath=
"fonts/PeridotPE-Regular.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:text=
"Acceleration"
android:layout_below=
"@+id/tv_sensor_data"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_velocity"
fontPath=
"fonts/PeridotPE-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_velocity_label"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_avg_label"
fontPath=
"fonts/PeridotPE-Regular.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:text=
"Velocity"
android:layout_below=
"@+id/tv_velocity"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_avg"
fontPath=
"fonts/PeridotPE-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_avg_label"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_records_label"
fontPath=
"fonts/PeridotPE-Regular.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:text=
"Records Saved"
android:layout_below=
"@+id/tv_avg"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_records"
fontPath=
"fonts/PeridotPE-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_records_label"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
<LinearLayout
android:id=
"@+id/ll_activate_button"
android:layout_width=
"match_parent"
android:layout_height=
"55dp"
android:layout_alignParentBottom=
"true"
android:layout_marginHorizontal=
"24dp"
android:layout_marginBottom=
"56dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_trip_button"
fontPath=
"fonts/PeridotPE-SemiBold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:text=
"@string/cos_dlg_start_trip"
android:textColor=
"@color/blue_dark"
android:textSize=
"16sp"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
warply_android_sdk/src/main/res/layout/fragment_home.xml
View file @
ec14fc9
...
...
@@ -103,29 +103,39 @@
android:background=
"@drawable/home_bg"
>
<RelativeLayout
android:id=
"@+id/rl_
home_campaigns
"
android:id=
"@+id/rl_
driving
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"50dp"
>
android:layout_height=
"140dp"
android:layout_marginHorizontal=
"8dp"
android:layout_marginTop=
"50dp"
android:layout_marginBottom=
"16dp"
android:background=
"@drawable/shape_cos_white"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_home_campaigns"
android:layout_width=
"match_parent"
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:background=
"#80FFFFFF"
android:clipToPadding=
"false"
android:orientation=
"horizontal"
android:paddingVertical=
"15dp"
android:paddingStart=
"10dp"
android:paddingEnd=
"10dp"
/>
android:layout_alignParentStart=
"true"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"16dp"
android:text=
"@string/cos_telematics"
android:textColor=
"@color/blue_dark"
android:textSize=
"20sp"
/>
<ImageView
android:id=
"@+id/iv_one_logo"
android:layout_width=
"100dp"
android:layout_height=
"30dp"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"16dp"
android:src=
"@drawable/cosmote_one"
/>
</RelativeLayout>
<LinearLayout
android:id=
"@+id/rl_home_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/rl_
home_campaigns
"
android:layout_below=
"@id/rl_
driving
"
android:visibility=
"gone"
>
<androidx.recyclerview.widget.RecyclerView
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
ec14fc9
...
...
@@ -176,6 +176,9 @@
<string
name=
"lbl_take_photo_accept"
>
Οκ
</string>
<string
name=
"lbl_take_photo_decline"
>
Άκυρο
</string>
<string
name=
"lbl_gps_enabled"
>
Θέλετε να ενεργοποιήσετε το GPS;
</string>
<string
name=
"cos_telematics"
>
Telematics Demo
</string>
<string
name=
"cos_dlg_start_trip"
>
Start Trip
</string>
<string
name=
"cos_dlg_stop_trip"
>
Stop Trip
</string>
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
...
...
Please
register
or
login
to post a comment