Showing
8 changed files
with
223 additions
and
28 deletions
.idea/deploymentTargetDropDown.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="deploymentTargetDropDown"> | ||
| 4 | + <runningDeviceTargetSelectedWithDropDown> | ||
| 5 | + <Target> | ||
| 6 | + <type value="RUNNING_DEVICE_TARGET" /> | ||
| 7 | + <deviceKey> | ||
| 8 | + <Key> | ||
| 9 | + <type value="SERIAL_NUMBER" /> | ||
| 10 | + <value value="R58M5262DCB" /> | ||
| 11 | + </Key> | ||
| 12 | + </deviceKey> | ||
| 13 | + </Target> | ||
| 14 | + </runningDeviceTargetSelectedWithDropDown> | ||
| 15 | + <timeTargetWasSelectedWithDropDown value="2023-06-27T13:21:52.853768900Z" /> | ||
| 16 | + </component> | ||
| 17 | +</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
| 3 | package="warp.ly.android_sdk"> | 3 | package="warp.ly.android_sdk"> |
| 4 | 4 | ||
| 5 | <uses-permission android:name="android.permission.INTERNET" /> | 5 | <uses-permission android:name="android.permission.INTERNET" /> |
| 6 | + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
| 6 | 7 | ||
| 7 | <!-- Restrict Tablets --> | 8 | <!-- Restrict Tablets --> |
| 8 | <!-- <supports-screens--> | 9 | <!-- <supports-screens--> |
| ... | @@ -23,6 +24,7 @@ | ... | @@ -23,6 +24,7 @@ |
| 23 | android:label="@string/app_name" | 24 | android:label="@string/app_name" |
| 24 | android:largeHeap="true" | 25 | android:largeHeap="true" |
| 25 | android:roundIcon="@mipmap/ic_launcher_round" | 26 | android:roundIcon="@mipmap/ic_launcher_round" |
| 27 | + android:requestLegacyExternalStorage="true" | ||
| 26 | android:theme="@style/AppTheme"> | 28 | android:theme="@style/AppTheme"> |
| 27 | <meta-data | 29 | <meta-data |
| 28 | android:name="com.google.android.geo.API_KEY" | 30 | android:name="com.google.android.geo.API_KEY" | ... | ... |
| ... | @@ -66,6 +66,12 @@ | ... | @@ -66,6 +66,12 @@ |
| 66 | android:theme="@style/SDKAppTheme" /> | 66 | android:theme="@style/SDKAppTheme" /> |
| 67 | 67 | ||
| 68 | <activity | 68 | <activity |
| 69 | + android:name="ly.warp.sdk.activities.TelematicsActivity" | ||
| 70 | + android:exported="false" | ||
| 71 | + android:screenOrientation="portrait" | ||
| 72 | + android:theme="@style/SDKAppTheme" /> | ||
| 73 | + | ||
| 74 | + <activity | ||
| 69 | android:name="ly.warp.sdk.activities.GiftsForYouActivity" | 75 | android:name="ly.warp.sdk.activities.GiftsForYouActivity" |
| 70 | android:exported="false" | 76 | android:exported="false" |
| 71 | android:screenOrientation="portrait" | 77 | android:screenOrientation="portrait" | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -22,6 +22,7 @@ import java.util.ArrayList; | ... | @@ -22,6 +22,7 @@ import java.util.ArrayList; |
| 22 | 22 | ||
| 23 | import ly.warp.sdk.R; | 23 | import ly.warp.sdk.R; |
| 24 | import ly.warp.sdk.activities.ActiveCouponsActivity; | 24 | import ly.warp.sdk.activities.ActiveCouponsActivity; |
| 25 | +import ly.warp.sdk.activities.TelematicsActivity; | ||
| 25 | import ly.warp.sdk.activities.WarpViewActivity; | 26 | import ly.warp.sdk.activities.WarpViewActivity; |
| 26 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 27 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
| 27 | import ly.warp.sdk.io.models.Campaign; | 28 | import ly.warp.sdk.io.models.Campaign; |
| ... | @@ -33,9 +34,7 @@ import ly.warp.sdk.views.adapters.HomeCampaignAdapter; | ... | @@ -33,9 +34,7 @@ import ly.warp.sdk.views.adapters.HomeCampaignAdapter; |
| 33 | 34 | ||
| 34 | public class HomeFragment extends Fragment implements View.OnClickListener, SwipeRefreshLayout.OnRefreshListener { | 35 | public class HomeFragment extends Fragment implements View.OnClickListener, SwipeRefreshLayout.OnRefreshListener { |
| 35 | 36 | ||
| 36 | - private RelativeLayout mOptionOne, mOptionTwo, mOptionThree; | 37 | + private RelativeLayout mOptionOne, mOptionTwo, mOptionThree, mRlDriving; |
| 37 | - private RecyclerView mRecyclerCampaigns; | ||
| 38 | - private HomeCampaignAdapter mAdapterCampaigns; | ||
| 39 | private LinearLayout mLlBillPayment; | 38 | private LinearLayout mLlBillPayment; |
| 40 | private TextView mTvUsername, mTvActiveCoupons; | 39 | private TextView mTvUsername, mTvActiveCoupons; |
| 41 | private ConstraintLayout mClActiveCoupons; | 40 | private ConstraintLayout mClActiveCoupons; |
| ... | @@ -86,17 +85,8 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -86,17 +85,8 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 86 | mTvUsername.setText(String.format(getResources().getString(R.string.welcome_user), | 85 | mTvUsername.setText(String.format(getResources().getString(R.string.welcome_user), |
| 87 | WarplyManagerHelper.getConsumer().getFirstName() + " " + WarplyManagerHelper.getConsumer().getLastName())); | 86 | WarplyManagerHelper.getConsumer().getFirstName() + " " + WarplyManagerHelper.getConsumer().getLastName())); |
| 88 | 87 | ||
| 89 | - mRecyclerCampaigns = view.findViewById(R.id.rv_home_campaigns); | 88 | + mRlDriving = view.findViewById(R.id.rl_driving); |
| 90 | - mRecyclerCampaigns.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | 89 | + mRlDriving.setOnClickListener(this); |
| 91 | - mAdapterCampaigns = new HomeCampaignAdapter(getContext(), WarplyManagerHelper.getUniqueCampaignList().get("homescreen")); | ||
| 92 | - mRecyclerCampaigns.setAdapter(mAdapterCampaigns); | ||
| 93 | - mAdapterCampaigns.getPositionClicks() | ||
| 94 | - .doOnNext(campaign -> { | ||
| 95 | - startActivity(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.constructCampaignUrl(campaign))); | ||
| 96 | - }) | ||
| 97 | - .doOnError(error -> { | ||
| 98 | - }) | ||
| 99 | - .subscribe(); | ||
| 100 | } | 90 | } |
| 101 | 91 | ||
| 102 | @Override | 92 | @Override |
| ... | @@ -117,6 +107,11 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -117,6 +107,11 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 117 | Intent intent = new Intent(getContext(), ActiveCouponsActivity.class); | 107 | Intent intent = new Intent(getContext(), ActiveCouponsActivity.class); |
| 118 | intent.putExtra("couponlist", WarplyManagerHelper.getCouponList()); | 108 | intent.putExtra("couponlist", WarplyManagerHelper.getCouponList()); |
| 119 | startActivity(intent); | 109 | startActivity(intent); |
| 110 | + return; | ||
| 111 | + } | ||
| 112 | + if (view.getId() == R.id.rl_driving) { | ||
| 113 | + Intent intent = new Intent(getContext(), TelematicsActivity.class); | ||
| 114 | + startActivity(intent); | ||
| 120 | } | 115 | } |
| 121 | } | 116 | } |
| 122 | 117 | ... | ... |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 4 | + android:id="@+id/ll_telematics_main" | ||
| 5 | + android:layout_width="match_parent" | ||
| 6 | + android:layout_height="match_parent" | ||
| 7 | + android:background="@color/cos_light_grey3" | ||
| 8 | + android:orientation="vertical"> | ||
| 9 | + | ||
| 10 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
| 11 | + android:id="@+id/cl_bill_header" | ||
| 12 | + android:layout_width="match_parent" | ||
| 13 | + android:layout_height="64dp" | ||
| 14 | + android:background="@color/white"> | ||
| 15 | + | ||
| 16 | + <ImageView | ||
| 17 | + android:id="@+id/iv_telematics_close" | ||
| 18 | + android:layout_width="48dp" | ||
| 19 | + android:layout_height="48dp" | ||
| 20 | + android:layout_marginStart="16dp" | ||
| 21 | + android:scaleType="centerInside" | ||
| 22 | + android:src="@drawable/ic_back" | ||
| 23 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 24 | + app:layout_constraintStart_toStartOf="parent" | ||
| 25 | + app:layout_constraintTop_toTopOf="parent" /> | ||
| 26 | + | ||
| 27 | + <TextView | ||
| 28 | + android:id="@+id/textView3" | ||
| 29 | + fontPath="fonts/BTCosmo-Bold.ttf" | ||
| 30 | + android:layout_width="wrap_content" | ||
| 31 | + android:layout_height="wrap_content" | ||
| 32 | + android:gravity="center" | ||
| 33 | + android:text="@string/cos_telematics" | ||
| 34 | + android:textColor="@color/cos_light_black" | ||
| 35 | + android:textSize="19sp" | ||
| 36 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 37 | + app:layout_constraintEnd_toEndOf="parent" | ||
| 38 | + app:layout_constraintStart_toStartOf="parent" | ||
| 39 | + app:layout_constraintTop_toTopOf="parent" /> | ||
| 40 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
| 41 | + | ||
| 42 | + <RelativeLayout | ||
| 43 | + android:layout_width="match_parent" | ||
| 44 | + android:layout_height="match_parent" | ||
| 45 | + android:background="@color/cos_light_grey3" | ||
| 46 | + android:gravity="center_horizontal"> | ||
| 47 | + | ||
| 48 | + <TextView | ||
| 49 | + android:id="@+id/tv_sensor_data_label" | ||
| 50 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 51 | + android:layout_width="wrap_content" | ||
| 52 | + android:layout_height="wrap_content" | ||
| 53 | + android:layout_centerHorizontal="true" | ||
| 54 | + android:layout_marginTop="24dp" | ||
| 55 | + android:text="Sensor Data" | ||
| 56 | + android:textColor="@color/blue_dark" | ||
| 57 | + android:textSize="16sp" /> | ||
| 58 | + | ||
| 59 | + <TextView | ||
| 60 | + android:id="@+id/tv_sensor_data" | ||
| 61 | + fontPath="fonts/PeridotPE-Bold.ttf" | ||
| 62 | + android:layout_width="wrap_content" | ||
| 63 | + android:layout_height="wrap_content" | ||
| 64 | + android:layout_below="@+id/tv_sensor_data_label" | ||
| 65 | + android:layout_centerHorizontal="true" | ||
| 66 | + android:layout_marginTop="24dp" | ||
| 67 | + android:textColor="@color/blue_dark" | ||
| 68 | + android:textSize="16sp" /> | ||
| 69 | + | ||
| 70 | + <TextView | ||
| 71 | + android:id="@+id/tv_velocity_label" | ||
| 72 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 73 | + android:layout_width="wrap_content" | ||
| 74 | + android:layout_height="wrap_content" | ||
| 75 | + android:layout_centerHorizontal="true" | ||
| 76 | + android:layout_marginTop="24dp" | ||
| 77 | + android:text="Acceleration" | ||
| 78 | + android:layout_below="@+id/tv_sensor_data" | ||
| 79 | + android:textColor="@color/blue_dark" | ||
| 80 | + android:textSize="16sp" /> | ||
| 81 | + | ||
| 82 | + <TextView | ||
| 83 | + android:id="@+id/tv_velocity" | ||
| 84 | + fontPath="fonts/PeridotPE-Bold.ttf" | ||
| 85 | + android:layout_width="wrap_content" | ||
| 86 | + android:layout_height="wrap_content" | ||
| 87 | + android:layout_below="@+id/tv_velocity_label" | ||
| 88 | + android:layout_centerHorizontal="true" | ||
| 89 | + android:layout_marginTop="24dp" | ||
| 90 | + android:textColor="@color/blue_dark" | ||
| 91 | + android:textSize="16sp" /> | ||
| 92 | + | ||
| 93 | + <TextView | ||
| 94 | + android:id="@+id/tv_avg_label" | ||
| 95 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 96 | + android:layout_width="wrap_content" | ||
| 97 | + android:layout_height="wrap_content" | ||
| 98 | + android:layout_centerHorizontal="true" | ||
| 99 | + android:layout_marginTop="24dp" | ||
| 100 | + android:text="Velocity" | ||
| 101 | + android:layout_below="@+id/tv_velocity" | ||
| 102 | + android:textColor="@color/blue_dark" | ||
| 103 | + android:textSize="16sp" /> | ||
| 104 | + | ||
| 105 | + <TextView | ||
| 106 | + android:id="@+id/tv_avg" | ||
| 107 | + fontPath="fonts/PeridotPE-Bold.ttf" | ||
| 108 | + android:layout_width="wrap_content" | ||
| 109 | + android:layout_height="wrap_content" | ||
| 110 | + android:layout_below="@+id/tv_avg_label" | ||
| 111 | + android:layout_centerHorizontal="true" | ||
| 112 | + android:layout_marginTop="24dp" | ||
| 113 | + android:textColor="@color/blue_dark" | ||
| 114 | + android:textSize="16sp" /> | ||
| 115 | + | ||
| 116 | + <TextView | ||
| 117 | + android:id="@+id/tv_records_label" | ||
| 118 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 119 | + android:layout_width="wrap_content" | ||
| 120 | + android:layout_height="wrap_content" | ||
| 121 | + android:layout_centerHorizontal="true" | ||
| 122 | + android:layout_marginTop="24dp" | ||
| 123 | + android:text="Records Saved" | ||
| 124 | + android:layout_below="@+id/tv_avg" | ||
| 125 | + android:textColor="@color/blue_dark" | ||
| 126 | + android:textSize="16sp" /> | ||
| 127 | + | ||
| 128 | + <TextView | ||
| 129 | + android:id="@+id/tv_records" | ||
| 130 | + fontPath="fonts/PeridotPE-Bold.ttf" | ||
| 131 | + android:layout_width="wrap_content" | ||
| 132 | + android:layout_height="wrap_content" | ||
| 133 | + android:layout_below="@+id/tv_records_label" | ||
| 134 | + android:layout_centerHorizontal="true" | ||
| 135 | + android:layout_marginTop="24dp" | ||
| 136 | + android:textColor="@color/blue_dark" | ||
| 137 | + android:textSize="16sp" /> | ||
| 138 | + | ||
| 139 | + <LinearLayout | ||
| 140 | + android:id="@+id/ll_activate_button" | ||
| 141 | + android:layout_width="match_parent" | ||
| 142 | + android:layout_height="55dp" | ||
| 143 | + android:layout_alignParentBottom="true" | ||
| 144 | + android:layout_marginHorizontal="24dp" | ||
| 145 | + android:layout_marginBottom="56dp" | ||
| 146 | + android:background="@drawable/selector_button_green_border" | ||
| 147 | + android:gravity="center" | ||
| 148 | + android:orientation="horizontal"> | ||
| 149 | + | ||
| 150 | + <TextView | ||
| 151 | + android:id="@+id/tv_trip_button" | ||
| 152 | + fontPath="fonts/PeridotPE-SemiBold.ttf" | ||
| 153 | + android:layout_width="wrap_content" | ||
| 154 | + android:layout_height="wrap_content" | ||
| 155 | + android:gravity="center" | ||
| 156 | + android:includeFontPadding="false" | ||
| 157 | + android:text="@string/cos_dlg_start_trip" | ||
| 158 | + android:textColor="@color/blue_dark" | ||
| 159 | + android:textSize="16sp" /> | ||
| 160 | + </LinearLayout> | ||
| 161 | + </RelativeLayout> | ||
| 162 | +</LinearLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -103,29 +103,39 @@ | ... | @@ -103,29 +103,39 @@ |
| 103 | android:background="@drawable/home_bg"> | 103 | android:background="@drawable/home_bg"> |
| 104 | 104 | ||
| 105 | <RelativeLayout | 105 | <RelativeLayout |
| 106 | - android:id="@+id/rl_home_campaigns" | 106 | + android:id="@+id/rl_driving" |
| 107 | android:layout_width="match_parent" | 107 | android:layout_width="match_parent" |
| 108 | - android:layout_height="wrap_content" | 108 | + android:layout_height="140dp" |
| 109 | - android:layout_marginTop="50dp"> | 109 | + android:layout_marginHorizontal="8dp" |
| 110 | + android:layout_marginTop="50dp" | ||
| 111 | + android:layout_marginBottom="16dp" | ||
| 112 | + android:background="@drawable/shape_cos_white"> | ||
| 110 | 113 | ||
| 111 | - <androidx.recyclerview.widget.RecyclerView | 114 | + <TextView |
| 112 | - android:id="@+id/rv_home_campaigns" | 115 | + android:layout_width="wrap_content" |
| 113 | - android:layout_width="match_parent" | ||
| 114 | android:layout_height="wrap_content" | 116 | android:layout_height="wrap_content" |
| 115 | - android:layout_marginBottom="8dp" | 117 | + android:layout_alignParentStart="true" |
| 116 | - android:background="#80FFFFFF" | 118 | + android:layout_centerVertical="true" |
| 117 | - android:clipToPadding="false" | 119 | + android:layout_marginStart="16dp" |
| 118 | - android:orientation="horizontal" | 120 | + android:text="@string/cos_telematics" |
| 119 | - android:paddingVertical="15dp" | 121 | + android:textColor="@color/blue_dark" |
| 120 | - android:paddingStart="10dp" | 122 | + android:textSize="20sp" /> |
| 121 | - android:paddingEnd="10dp" /> | 123 | + |
| 124 | + <ImageView | ||
| 125 | + android:id="@+id/iv_one_logo" | ||
| 126 | + android:layout_width="100dp" | ||
| 127 | + android:layout_height="30dp" | ||
| 128 | + android:layout_alignParentEnd="true" | ||
| 129 | + android:layout_centerVertical="true" | ||
| 130 | + android:layout_marginEnd="16dp" | ||
| 131 | + android:src="@drawable/cosmote_one" /> | ||
| 122 | </RelativeLayout> | 132 | </RelativeLayout> |
| 123 | 133 | ||
| 124 | <LinearLayout | 134 | <LinearLayout |
| 125 | android:id="@+id/rl_home_coupons" | 135 | android:id="@+id/rl_home_coupons" |
| 126 | android:layout_width="match_parent" | 136 | android:layout_width="match_parent" |
| 127 | android:layout_height="wrap_content" | 137 | android:layout_height="wrap_content" |
| 128 | - android:layout_below="@id/rl_home_campaigns" | 138 | + android:layout_below="@id/rl_driving" |
| 129 | android:visibility="gone"> | 139 | android:visibility="gone"> |
| 130 | 140 | ||
| 131 | <androidx.recyclerview.widget.RecyclerView | 141 | <androidx.recyclerview.widget.RecyclerView | ... | ... |
| ... | @@ -176,6 +176,9 @@ | ... | @@ -176,6 +176,9 @@ |
| 176 | <string name="lbl_take_photo_accept">Οκ</string> | 176 | <string name="lbl_take_photo_accept">Οκ</string> |
| 177 | <string name="lbl_take_photo_decline">Άκυρο</string> | 177 | <string name="lbl_take_photo_decline">Άκυρο</string> |
| 178 | <string name="lbl_gps_enabled">Θέλετε να ενεργοποιήσετε το GPS;</string> | 178 | <string name="lbl_gps_enabled">Θέλετε να ενεργοποιήσετε το GPS;</string> |
| 179 | + <string name="cos_telematics">Telematics Demo</string> | ||
| 180 | + <string name="cos_dlg_start_trip">Start Trip</string> | ||
| 181 | + <string name="cos_dlg_stop_trip">Stop Trip</string> | ||
| 179 | 182 | ||
| 180 | <string-array name="coupons_array"> | 183 | <string-array name="coupons_array"> |
| 181 | <item>Κουπόνια</item> | 184 | <item>Κουπόνια</item> | ... | ... |
-
Please register or login to post a comment