Showing
15 changed files
with
258 additions
and
16 deletions
| ... | @@ -26,6 +26,10 @@ | ... | @@ -26,6 +26,10 @@ |
| 26 | android:requestLegacyExternalStorage="true" | 26 | android:requestLegacyExternalStorage="true" |
| 27 | android:theme="@style/AppTheme"> | 27 | android:theme="@style/AppTheme"> |
| 28 | 28 | ||
| 29 | + <meta-data | ||
| 30 | + android:name="com.google.android.geo.API_KEY" | ||
| 31 | + android:value="@string/google_maps_key" /> | ||
| 32 | + | ||
| 29 | <activity | 33 | <activity |
| 30 | android:name="warp.ly.android_sdk.activities.SplashActivity" | 34 | android:name="warp.ly.android_sdk.activities.SplashActivity" |
| 31 | android:exported="true" | 35 | android:exported="true" | ... | ... |
| ... | @@ -81,6 +81,8 @@ dependencies { | ... | @@ -81,6 +81,8 @@ dependencies { |
| 81 | //------------------------------ GMS -----------------------------// | 81 | //------------------------------ GMS -----------------------------// |
| 82 | implementation 'com.google.android.gms:play-services-base:18.7.2' | 82 | implementation 'com.google.android.gms:play-services-base:18.7.2' |
| 83 | implementation 'com.google.android.gms:play-services-location:21.3.0' | 83 | implementation 'com.google.android.gms:play-services-location:21.3.0' |
| 84 | + implementation 'com.google.android.gms:play-services-maps:18.2.0' | ||
| 85 | + implementation 'com.google.maps.android:android-maps-utils:0.5' | ||
| 84 | 86 | ||
| 85 | //------------------------------ Work Manager -----------------------------// | 87 | //------------------------------ Work Manager -----------------------------// |
| 86 | implementation 'androidx.work:work-runtime:2.10.3' | 88 | implementation 'androidx.work:work-runtime:2.10.3' | ... | ... |
| ... | @@ -63,6 +63,12 @@ | ... | @@ -63,6 +63,12 @@ |
| 63 | android:theme="@style/SDKAppTheme" /> | 63 | android:theme="@style/SDKAppTheme" /> |
| 64 | 64 | ||
| 65 | <activity | 65 | <activity |
| 66 | + android:name=".activities.ShopsActivity" | ||
| 67 | + android:exported="false" | ||
| 68 | + android:screenOrientation="portrait" | ||
| 69 | + android:theme="@style/SDKAppTheme" /> | ||
| 70 | + | ||
| 71 | + <activity | ||
| 66 | android:name=".dexter.PermissionsActivity" | 72 | android:name=".dexter.PermissionsActivity" |
| 67 | android:exported="false" | 73 | android:exported="false" |
| 68 | android:launchMode="singleInstance" | 74 | android:launchMode="singleInstance" | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -34,6 +34,7 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen | ... | @@ -34,6 +34,7 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen |
| 34 | // Constants | 34 | // Constants |
| 35 | // =========================================================== | 35 | // =========================================================== |
| 36 | public static final String EXTRA_OFFER_ITEM = "coupon_item"; | 36 | public static final String EXTRA_OFFER_ITEM = "coupon_item"; |
| 37 | + public static final String EXTRA_MERCHANT_UUID = "merchant_uuid"; | ||
| 37 | 38 | ||
| 38 | // =========================================================== | 39 | // =========================================================== |
| 39 | // Fields | 40 | // Fields |
| ... | @@ -44,7 +45,7 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen | ... | @@ -44,7 +45,7 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen |
| 44 | private TextView mTvSmallDescription; | 45 | private TextView mTvSmallDescription; |
| 45 | private TextView mTvFullDescription; | 46 | private TextView mTvFullDescription; |
| 46 | private TextView mTvEndDate; | 47 | private TextView mTvEndDate; |
| 47 | - private LinearLayout mLlDate; | 48 | + private LinearLayout mLlDate, mLlShopsButton; |
| 48 | private TextView mTvValue; | 49 | private TextView mTvValue; |
| 49 | private TextView mTvMoreButton; | 50 | private TextView mTvMoreButton; |
| 50 | private ImageView mIvImage; | 51 | private ImageView mIvImage; |
| ... | @@ -96,6 +97,19 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen | ... | @@ -96,6 +97,19 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen |
| 96 | super.onResume(); | 97 | super.onResume(); |
| 97 | } | 98 | } |
| 98 | 99 | ||
| 100 | + @Override | ||
| 101 | + public void onClick(View v) { | ||
| 102 | + if (v.getId() == R.id.iv_back) { | ||
| 103 | + onBackPressed(); | ||
| 104 | + return; | ||
| 105 | + } | ||
| 106 | + if (v.getId() == R.id.ll_shops) { | ||
| 107 | + Intent myIntent = new Intent(SingleCouponActivity.this, ShopsActivity.class); | ||
| 108 | + myIntent.putExtra(SingleCouponActivity.EXTRA_MERCHANT_UUID, mOfferItem.getMerchantUuid()); | ||
| 109 | + startActivity(myIntent); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 99 | // =========================================================== | 113 | // =========================================================== |
| 100 | // Methods | 114 | // Methods |
| 101 | // =========================================================== | 115 | // =========================================================== |
| ... | @@ -104,6 +118,9 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen | ... | @@ -104,6 +118,9 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen |
| 104 | mIvBack = findViewById(R.id.iv_back); | 118 | mIvBack = findViewById(R.id.iv_back); |
| 105 | mIvBack.setOnClickListener(this); | 119 | mIvBack.setOnClickListener(this); |
| 106 | 120 | ||
| 121 | + mLlShopsButton = findViewById(R.id.ll_shops); | ||
| 122 | + mLlShopsButton.setOnClickListener(this); | ||
| 123 | + | ||
| 107 | // Initialize views | 124 | // Initialize views |
| 108 | mTvSmallDescription = findViewById(R.id.tv_coupon_small_description); | 125 | mTvSmallDescription = findViewById(R.id.tv_coupon_small_description); |
| 109 | mTvFullDescription = findViewById(R.id.tv_coupon_full_description); | 126 | mTvFullDescription = findViewById(R.id.tv_coupon_full_description); |
| ... | @@ -336,13 +353,6 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen | ... | @@ -336,13 +353,6 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen |
| 336 | } | 353 | } |
| 337 | } | 354 | } |
| 338 | 355 | ||
| 339 | - @Override | ||
| 340 | - public void onClick(View v) { | ||
| 341 | - if (v.getId() == R.id.iv_back) { | ||
| 342 | - onBackPressed(); | ||
| 343 | - } | ||
| 344 | - } | ||
| 345 | - | ||
| 346 | // =========================================================== | 356 | // =========================================================== |
| 347 | // Inner and Anonymous Classes | 357 | // Inner and Anonymous Classes |
| 348 | // =========================================================== | 358 | // =========================================================== | ... | ... |
| ... | @@ -28,6 +28,9 @@ package ly.warp.sdk.io.models; | ... | @@ -28,6 +28,9 @@ package ly.warp.sdk.io.models; |
| 28 | import android.os.Parcel; | 28 | import android.os.Parcel; |
| 29 | import android.os.Parcelable; | 29 | import android.os.Parcelable; |
| 30 | 30 | ||
| 31 | +import com.google.android.gms.maps.model.LatLng; | ||
| 32 | +import com.google.maps.android.clustering.ClusterItem; | ||
| 33 | + | ||
| 31 | import org.json.JSONArray; | 34 | import org.json.JSONArray; |
| 32 | import org.json.JSONException; | 35 | import org.json.JSONException; |
| 33 | import org.json.JSONObject; | 36 | import org.json.JSONObject; |
| ... | @@ -42,7 +45,7 @@ import ly.warp.sdk.utils.constants.WarpConstants; | ... | @@ -42,7 +45,7 @@ import ly.warp.sdk.utils.constants.WarpConstants; |
| 42 | * Created by Panagiotis Triantafyllou on 07-Dec-21. | 45 | * Created by Panagiotis Triantafyllou on 07-Dec-21. |
| 43 | */ | 46 | */ |
| 44 | 47 | ||
| 45 | -public class Merchant implements Parcelable, Serializable { | 48 | +public class Merchant implements Parcelable, Serializable, ClusterItem { |
| 46 | 49 | ||
| 47 | private static final long serialVersionUID = -4754964462459705285L; | 50 | private static final long serialVersionUID = -4754964462459705285L; |
| 48 | 51 | ||
| ... | @@ -73,6 +76,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -73,6 +76,7 @@ public class Merchant implements Parcelable, Serializable { |
| 73 | private static final String CATEGORY_UUID = "category_uuid"; | 76 | private static final String CATEGORY_UUID = "category_uuid"; |
| 74 | private static final String CREATED = "created"; | 77 | private static final String CREATED = "created"; |
| 75 | private static final String PARENT = "parent"; | 78 | private static final String PARENT = "parent"; |
| 79 | + private static final String PARENT_UUID = "parent_uuid"; | ||
| 76 | private static final String IMG = "img"; | 80 | private static final String IMG = "img"; |
| 77 | private static final String IMG_PREVIEW = "img_preview"; | 81 | private static final String IMG_PREVIEW = "img_preview"; |
| 78 | private static final String ADMIN_NAME = "admin_name"; | 82 | private static final String ADMIN_NAME = "admin_name"; |
| ... | @@ -125,6 +129,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -125,6 +129,7 @@ public class Merchant implements Parcelable, Serializable { |
| 125 | private String category_uuid; | 129 | private String category_uuid; |
| 126 | private String created; | 130 | private String created; |
| 127 | private String parent; | 131 | private String parent; |
| 132 | + private String parentUuid; | ||
| 128 | private JSONArray img; | 133 | private JSONArray img; |
| 129 | private String img_preview; | 134 | private String img_preview; |
| 130 | private String admin_name; | 135 | private String admin_name; |
| ... | @@ -149,6 +154,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -149,6 +154,7 @@ public class Merchant implements Parcelable, Serializable { |
| 149 | private String minPrice; | 154 | private String minPrice; |
| 150 | private String maxPrice; | 155 | private String maxPrice; |
| 151 | private String urlName; | 156 | private String urlName; |
| 157 | + private LatLng coordinates; | ||
| 152 | 158 | ||
| 153 | /** | 159 | /** |
| 154 | * Helper method to get a nullable String from a JSONObject. | 160 | * Helper method to get a nullable String from a JSONObject. |
| ... | @@ -184,6 +190,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -184,6 +190,7 @@ public class Merchant implements Parcelable, Serializable { |
| 184 | this.category_uuid = null; | 190 | this.category_uuid = null; |
| 185 | this.created = null; | 191 | this.created = null; |
| 186 | this.parent = null; | 192 | this.parent = null; |
| 193 | + this.parentUuid = null; | ||
| 187 | this.img = null; | 194 | this.img = null; |
| 188 | this.img_preview = null; | 195 | this.img_preview = null; |
| 189 | this.admin_name = null; | 196 | this.admin_name = null; |
| ... | @@ -208,6 +215,9 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -208,6 +215,9 @@ public class Merchant implements Parcelable, Serializable { |
| 208 | this.minPrice = null; | 215 | this.minPrice = null; |
| 209 | this.maxPrice = null; | 216 | this.maxPrice = null; |
| 210 | this.urlName = null; | 217 | this.urlName = null; |
| 218 | + this.coordinates = new LatLng( | ||
| 219 | + this.latitude != null ? this.latitude : 0.0, | ||
| 220 | + this.longitude != null ? this.longitude : 0.0); | ||
| 211 | } | 221 | } |
| 212 | 222 | ||
| 213 | public Merchant(boolean isUniversal) { | 223 | public Merchant(boolean isUniversal) { |
| ... | @@ -269,6 +279,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -269,6 +279,7 @@ public class Merchant implements Parcelable, Serializable { |
| 269 | this.category_uuid = optNullableString(json, CATEGORY_UUID); | 279 | this.category_uuid = optNullableString(json, CATEGORY_UUID); |
| 270 | this.created = optNullableString(json, CREATED); | 280 | this.created = optNullableString(json, CREATED); |
| 271 | this.parent = optNullableString(json, PARENT); | 281 | this.parent = optNullableString(json, PARENT); |
| 282 | + this.parentUuid = optNullableString(json, PARENT_UUID); | ||
| 272 | this.img = json.optJSONArray(IMG); | 283 | this.img = json.optJSONArray(IMG); |
| 273 | this.img_preview = optNullableString(json, IMG_PREVIEW); | 284 | this.img_preview = optNullableString(json, IMG_PREVIEW); |
| 274 | this.admin_name = optNullableString(json, ADMIN_NAME); | 285 | this.admin_name = optNullableString(json, ADMIN_NAME); |
| ... | @@ -293,6 +304,9 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -293,6 +304,9 @@ public class Merchant implements Parcelable, Serializable { |
| 293 | this.minPrice = optNullableString(json, MIN_PRICE); | 304 | this.minPrice = optNullableString(json, MIN_PRICE); |
| 294 | this.maxPrice = optNullableString(json, MAX_PRICE); | 305 | this.maxPrice = optNullableString(json, MAX_PRICE); |
| 295 | this.urlName = optNullableString(json, URL_NAME); | 306 | this.urlName = optNullableString(json, URL_NAME); |
| 307 | + this.coordinates = new LatLng( | ||
| 308 | + this.latitude != null ? this.latitude : 0.0, | ||
| 309 | + this.longitude != null ? this.longitude : 0.0); | ||
| 296 | } | 310 | } |
| 297 | } | 311 | } |
| 298 | 312 | ||
| ... | @@ -347,6 +361,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -347,6 +361,7 @@ public class Merchant implements Parcelable, Serializable { |
| 347 | this.category_uuid = source.readString(); | 361 | this.category_uuid = source.readString(); |
| 348 | this.created = source.readString(); | 362 | this.created = source.readString(); |
| 349 | this.parent = source.readString(); | 363 | this.parent = source.readString(); |
| 364 | + this.parentUuid = source.readString(); | ||
| 350 | try { | 365 | try { |
| 351 | String imgStr = source.readString(); | 366 | String imgStr = source.readString(); |
| 352 | this.img = imgStr != null ? new JSONArray(imgStr) : null; | 367 | this.img = imgStr != null ? new JSONArray(imgStr) : null; |
| ... | @@ -393,6 +408,9 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -393,6 +408,9 @@ public class Merchant implements Parcelable, Serializable { |
| 393 | this.minPrice = source.readString(); | 408 | this.minPrice = source.readString(); |
| 394 | this.maxPrice = source.readString(); | 409 | this.maxPrice = source.readString(); |
| 395 | this.urlName = source.readString(); | 410 | this.urlName = source.readString(); |
| 411 | + this.coordinates = new LatLng( | ||
| 412 | + this.latitude != null ? this.latitude : 0.0, | ||
| 413 | + this.longitude != null ? this.longitude : 0.0); | ||
| 396 | } | 414 | } |
| 397 | 415 | ||
| 398 | @Override | 416 | @Override |
| ... | @@ -422,6 +440,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -422,6 +440,7 @@ public class Merchant implements Parcelable, Serializable { |
| 422 | dest.writeString(this.category_uuid); | 440 | dest.writeString(this.category_uuid); |
| 423 | dest.writeString(this.created); | 441 | dest.writeString(this.created); |
| 424 | dest.writeString(this.parent); | 442 | dest.writeString(this.parent); |
| 443 | + dest.writeString(this.parentUuid); | ||
| 425 | dest.writeString(this.img != null ? this.img.toString() : null); | 444 | dest.writeString(this.img != null ? this.img.toString() : null); |
| 426 | dest.writeString(this.img_preview); | 445 | dest.writeString(this.img_preview); |
| 427 | dest.writeString(this.admin_name); | 446 | dest.writeString(this.admin_name); |
| ... | @@ -446,6 +465,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -446,6 +465,7 @@ public class Merchant implements Parcelable, Serializable { |
| 446 | dest.writeString(this.minPrice); | 465 | dest.writeString(this.minPrice); |
| 447 | dest.writeString(this.maxPrice); | 466 | dest.writeString(this.maxPrice); |
| 448 | dest.writeString(this.urlName); | 467 | dest.writeString(this.urlName); |
| 468 | + dest.writeParcelable(coordinates, flags); | ||
| 449 | } | 469 | } |
| 450 | 470 | ||
| 451 | /** | 471 | /** |
| ... | @@ -481,6 +501,7 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -481,6 +501,7 @@ public class Merchant implements Parcelable, Serializable { |
| 481 | jObj.put(CATEGORY_UUID, this.category_uuid != null ? this.category_uuid : JSONObject.NULL); | 501 | jObj.put(CATEGORY_UUID, this.category_uuid != null ? this.category_uuid : JSONObject.NULL); |
| 482 | jObj.put(CREATED, this.created != null ? this.created : JSONObject.NULL); | 502 | jObj.put(CREATED, this.created != null ? this.created : JSONObject.NULL); |
| 483 | jObj.put(PARENT, this.parent != null ? this.parent : JSONObject.NULL); | 503 | jObj.put(PARENT, this.parent != null ? this.parent : JSONObject.NULL); |
| 504 | + jObj.put(PARENT_UUID, this.parentUuid != null ? this.parentUuid : JSONObject.NULL); | ||
| 484 | jObj.put(IMG, this.img != null ? this.img : JSONObject.NULL); | 505 | jObj.put(IMG, this.img != null ? this.img : JSONObject.NULL); |
| 485 | jObj.put(IMG_PREVIEW, this.img_preview != null ? this.img_preview : JSONObject.NULL); | 506 | jObj.put(IMG_PREVIEW, this.img_preview != null ? this.img_preview : JSONObject.NULL); |
| 486 | jObj.put(ADMIN_NAME, this.admin_name != null ? this.admin_name : JSONObject.NULL); | 507 | jObj.put(ADMIN_NAME, this.admin_name != null ? this.admin_name : JSONObject.NULL); |
| ... | @@ -661,6 +682,10 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -661,6 +682,10 @@ public class Merchant implements Parcelable, Serializable { |
| 661 | return parent; | 682 | return parent; |
| 662 | } | 683 | } |
| 663 | 684 | ||
| 685 | + public String getParentUuid() { | ||
| 686 | + return parentUuid; | ||
| 687 | + } | ||
| 688 | + | ||
| 664 | public ArrayList<String> getImg() { | 689 | public ArrayList<String> getImg() { |
| 665 | return jsonArrayToList(img); | 690 | return jsonArrayToList(img); |
| 666 | } | 691 | } |
| ... | @@ -869,6 +894,10 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -869,6 +894,10 @@ public class Merchant implements Parcelable, Serializable { |
| 869 | this.parent = parent; | 894 | this.parent = parent; |
| 870 | } | 895 | } |
| 871 | 896 | ||
| 897 | + public void setParentUuid(String parentUuid) { | ||
| 898 | + this.parentUuid = parentUuid; | ||
| 899 | + } | ||
| 900 | + | ||
| 872 | public void setImg(JSONArray img) { | 901 | public void setImg(JSONArray img) { |
| 873 | this.img = img; | 902 | this.img = img; |
| 874 | } | 903 | } |
| ... | @@ -965,6 +994,10 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -965,6 +994,10 @@ public class Merchant implements Parcelable, Serializable { |
| 965 | this.urlName = urlName; | 994 | this.urlName = urlName; |
| 966 | } | 995 | } |
| 967 | 996 | ||
| 997 | + public void setCoordinates(LatLng coordinates) { | ||
| 998 | + this.coordinates = coordinates; | ||
| 999 | + } | ||
| 1000 | + | ||
| 968 | @Override | 1001 | @Override |
| 969 | public int describeContents() { | 1002 | public int describeContents() { |
| 970 | return 0; | 1003 | return 0; |
| ... | @@ -989,4 +1022,17 @@ public class Merchant implements Parcelable, Serializable { | ... | @@ -989,4 +1022,17 @@ public class Merchant implements Parcelable, Serializable { |
| 989 | } | 1022 | } |
| 990 | return listData; | 1023 | return listData; |
| 991 | } | 1024 | } |
| 1025 | + | ||
| 1026 | + @Override | ||
| 1027 | + public LatLng getPosition() { | ||
| 1028 | + return coordinates; | ||
| 1029 | + } | ||
| 1030 | + @Override | ||
| 1031 | + public String getTitle() { | ||
| 1032 | + return null; | ||
| 1033 | + } | ||
| 1034 | + @Override | ||
| 1035 | + public String getSnippet() { | ||
| 1036 | + return null; | ||
| 1037 | + } | ||
| 992 | } | 1038 | } | ... | ... |
| ... | @@ -157,6 +157,17 @@ public interface ApiService { | ... | @@ -157,6 +157,17 @@ public interface ApiService { |
| 157 | @Header(WarpConstants.HEADER_WEB_ID) String webId, | 157 | @Header(WarpConstants.HEADER_WEB_ID) String webId, |
| 158 | @Header(WarpConstants.HEADER_SIGNATURE) String signature); | 158 | @Header(WarpConstants.HEADER_SIGNATURE) String signature); |
| 159 | 159 | ||
| 160 | + @Headers("Content-Type: application/json") | ||
| 161 | + @POST("/api/mobile/v2/{appUuid}/context/") | ||
| 162 | + Call<ResponseBody> getStores(@Path("appUuid") String appUuid, | ||
| 163 | + @Body RequestBody request, | ||
| 164 | + @Header(WarpConstants.HEADER_DATE) String timeStamp, | ||
| 165 | + @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | ||
| 166 | + @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | ||
| 167 | + @Header(WarpConstants.HEADER_CHANNEL) String channel, | ||
| 168 | + @Header(WarpConstants.HEADER_WEB_ID) String webId, | ||
| 169 | + @Header(WarpConstants.HEADER_SIGNATURE) String signature); | ||
| 170 | + | ||
| 160 | // =========================================================== | 171 | // =========================================================== |
| 161 | // Getter & Setter | 172 | // Getter & Setter |
| 162 | // =========================================================== | 173 | // =========================================================== | ... | ... |
| 1 | +package ly.warp.sdk.utils; | ||
| 2 | + | ||
| 3 | +import android.graphics.Bitmap; | ||
| 4 | +import android.graphics.Canvas; | ||
| 5 | +import android.graphics.ColorMatrix; | ||
| 6 | +import android.graphics.ColorMatrixColorFilter; | ||
| 7 | +import android.graphics.Paint; | ||
| 8 | + | ||
| 9 | +import androidx.annotation.NonNull; | ||
| 10 | + | ||
| 11 | +import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; | ||
| 12 | +import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; | ||
| 13 | + | ||
| 14 | +import java.security.MessageDigest; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Glide transformation that renders a bitmap in grayscale | ||
| 18 | + */ | ||
| 19 | +public class GrayscaleTransformation extends BitmapTransformation { | ||
| 20 | + private static final String ID = "ly.warp.sdk.utils.GrayscaleTransformation"; | ||
| 21 | + | ||
| 22 | + @Override | ||
| 23 | + protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) { | ||
| 24 | + Bitmap result = pool.get(toTransform.getWidth(), toTransform.getHeight(), Bitmap.Config.ARGB_8888); | ||
| 25 | + if (result == null) { | ||
| 26 | + result = Bitmap.createBitmap(toTransform.getWidth(), toTransform.getHeight(), Bitmap.Config.ARGB_8888); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + ColorMatrix colorMatrix = new ColorMatrix(); | ||
| 30 | + colorMatrix.setSaturation(0f); | ||
| 31 | + | ||
| 32 | + Paint paint = new Paint(); | ||
| 33 | + paint.setColorFilter(new ColorMatrixColorFilter(colorMatrix)); | ||
| 34 | + | ||
| 35 | + Canvas canvas = new Canvas(result); | ||
| 36 | + canvas.drawBitmap(toTransform, 0, 0, paint); | ||
| 37 | + | ||
| 38 | + return result; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) { | ||
| 43 | + messageDigest.update(ID.getBytes()); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + @Override | ||
| 47 | + public boolean equals(Object o) { | ||
| 48 | + return o instanceof GrayscaleTransformation; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public int hashCode() { | ||
| 53 | + return ID.hashCode(); | ||
| 54 | + } | ||
| 55 | +} |
| ... | @@ -25,6 +25,9 @@ | ... | @@ -25,6 +25,9 @@ |
| 25 | 25 | ||
| 26 | package ly.warp.sdk.utils.constants; | 26 | package ly.warp.sdk.utils.constants; |
| 27 | 27 | ||
| 28 | +import com.google.android.gms.maps.model.LatLng; | ||
| 29 | +import com.google.android.gms.maps.model.LatLngBounds; | ||
| 30 | + | ||
| 28 | public class WarpConstants { | 31 | public class WarpConstants { |
| 29 | 32 | ||
| 30 | /** | 33 | /** |
| ... | @@ -87,6 +90,11 @@ public class WarpConstants { | ... | @@ -87,6 +90,11 @@ public class WarpConstants { |
| 87 | public static boolean DEBUG; | 90 | public static boolean DEBUG; |
| 88 | public static String GCM_SENDER_ID; | 91 | public static String GCM_SENDER_ID; |
| 89 | 92 | ||
| 93 | + public static final LatLngBounds GREECE_BOUNDS = new LatLngBounds( | ||
| 94 | + new LatLng(34.75261, 19.33079), | ||
| 95 | + new LatLng(41.97761, 28.62522) | ||
| 96 | + ); | ||
| 97 | + | ||
| 90 | /* | 98 | /* |
| 91 | * if was received the campaign with this category need expires date define | 99 | * if was received the campaign with this category need expires date define |
| 92 | * as 0 (for no show it in app need check on 0 or if the date is correct) | 100 | * as 0 (for no show it in app need check on 0 or if the date is correct) | ... | ... |
This diff is collapsed. Click to expand it.
724 Bytes
9.44 KB
| 1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + android:layout_width="match_parent" | ||
| 3 | + android:layout_height="match_parent" | ||
| 4 | + android:background="@color/white"> | ||
| 5 | + | ||
| 6 | + <LinearLayout | ||
| 7 | + android:id="@+id/header_layout" | ||
| 8 | + android:layout_width="match_parent" | ||
| 9 | + android:layout_height="wrap_content" | ||
| 10 | + android:layout_gravity="center" | ||
| 11 | + android:background="@color/white" | ||
| 12 | + android:baselineAligned="false" | ||
| 13 | + android:orientation="horizontal" | ||
| 14 | + android:padding="16dp"> | ||
| 15 | + | ||
| 16 | + <LinearLayout | ||
| 17 | + android:layout_width="0dp" | ||
| 18 | + android:layout_height="wrap_content" | ||
| 19 | + android:layout_weight="1" | ||
| 20 | + android:gravity="center_vertical" | ||
| 21 | + android:orientation="horizontal"> | ||
| 22 | + | ||
| 23 | + <ImageView | ||
| 24 | + android:id="@+id/iv_back" | ||
| 25 | + android:layout_width="16dp" | ||
| 26 | + android:layout_height="16dp" | ||
| 27 | + android:layout_marginEnd="24dp" | ||
| 28 | + android:src="@drawable/ic_back" /> | ||
| 29 | + </LinearLayout> | ||
| 30 | + </LinearLayout> | ||
| 31 | + | ||
| 32 | + <LinearLayout | ||
| 33 | + android:id="@+id/header_layout2" | ||
| 34 | + android:layout_width="match_parent" | ||
| 35 | + android:layout_height="wrap_content" | ||
| 36 | + android:layout_below="@+id/header_layout" | ||
| 37 | + android:background="@color/white" | ||
| 38 | + android:orientation="vertical" | ||
| 39 | + android:paddingHorizontal="16dp" | ||
| 40 | + android:paddingBottom="16dp"> | ||
| 41 | + | ||
| 42 | + <LinearLayout | ||
| 43 | + android:layout_width="wrap_content" | ||
| 44 | + android:layout_height="wrap_content" | ||
| 45 | + android:orientation="vertical"> | ||
| 46 | + | ||
| 47 | + <TextView | ||
| 48 | + android:id="@+id/tv_header_title" | ||
| 49 | + android:layout_width="wrap_content" | ||
| 50 | + android:layout_height="wrap_content" | ||
| 51 | + android:includeFontPadding="false" | ||
| 52 | + android:text="@string/demo_partners_title" | ||
| 53 | + android:textColor="@color/custom_black6" | ||
| 54 | + android:textSize="28sp" /> | ||
| 55 | + </LinearLayout> | ||
| 56 | + | ||
| 57 | + <LinearLayout | ||
| 58 | + android:id="@+id/ll_search_filter_button" | ||
| 59 | + android:layout_width="wrap_content" | ||
| 60 | + android:layout_height="wrap_content" | ||
| 61 | + android:layout_marginTop="12dp" | ||
| 62 | + android:background="@drawable/shape_rectangle_rounded_grey4" | ||
| 63 | + android:gravity="center" | ||
| 64 | + android:paddingHorizontal="20dp" | ||
| 65 | + android:paddingVertical="12dp"> | ||
| 66 | + | ||
| 67 | + <TextView | ||
| 68 | + android:id="@+id/tv_search_title" | ||
| 69 | + android:layout_width="wrap_content" | ||
| 70 | + android:layout_height="wrap_content" | ||
| 71 | + android:gravity="center" | ||
| 72 | + android:includeFontPadding="false" | ||
| 73 | + android:text="@string/demo_search_title" | ||
| 74 | + android:textColor="@color/custom_black6" | ||
| 75 | + android:textSize="14sp" /> | ||
| 76 | + | ||
| 77 | + <View | ||
| 78 | + android:layout_width="12dp" | ||
| 79 | + android:layout_height="match_parent" /> | ||
| 80 | + | ||
| 81 | + <ImageView | ||
| 82 | + android:layout_width="16dp" | ||
| 83 | + android:layout_height="16dp" | ||
| 84 | + android:src="@drawable/demo_filter" /> | ||
| 85 | + </LinearLayout> | ||
| 86 | + </LinearLayout> | ||
| 87 | + | ||
| 88 | + <RelativeLayout | ||
| 89 | + android:id="@+id/cl_loyalty_info_view_inner" | ||
| 90 | + android:layout_width="match_parent" | ||
| 91 | + android:layout_height="match_parent" | ||
| 92 | + android:layout_below="@+id/header_layout2"> | ||
| 93 | + | ||
| 94 | + <fragment | ||
| 95 | + android:id="@+id/mv_shops" | ||
| 96 | + class="com.google.android.gms.maps.SupportMapFragment" | ||
| 97 | + android:layout_width="match_parent" | ||
| 98 | + android:layout_height="match_parent" /> | ||
| 99 | + </RelativeLayout> | ||
| 100 | +</RelativeLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -22,12 +22,6 @@ | ... | @@ -22,12 +22,6 @@ |
| 22 | android:layout_height="260dp" | 22 | android:layout_height="260dp" |
| 23 | android:background="@color/custom_skyblue3"> | 23 | android:background="@color/custom_skyblue3"> |
| 24 | 24 | ||
| 25 | - <TextView | ||
| 26 | - android:id="@+id/textView" | ||
| 27 | - android:layout_width="wrap_content" | ||
| 28 | - android:layout_height="wrap_content" | ||
| 29 | - android:text="coupon_code_content" /> | ||
| 30 | - | ||
| 31 | <ImageView | 25 | <ImageView |
| 32 | android:id="@+id/iv_coupon_image" | 26 | android:id="@+id/iv_coupon_image" |
| 33 | android:layout_width="match_parent" | 27 | android:layout_width="match_parent" |
| ... | @@ -254,6 +248,7 @@ | ... | @@ -254,6 +248,7 @@ |
| 254 | </androidx.constraintlayout.widget.ConstraintLayout> | 248 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 255 | 249 | ||
| 256 | <LinearLayout | 250 | <LinearLayout |
| 251 | + android:id="@+id/ll_shops" | ||
| 257 | android:layout_width="match_parent" | 252 | android:layout_width="match_parent" |
| 258 | android:layout_height="55dp" | 253 | android:layout_height="55dp" |
| 259 | android:layout_marginTop="32dp" | 254 | android:layout_marginTop="32dp" | ... | ... |
| 1 | <resources> | 1 | <resources> |
| 2 | + <string name="google_maps_key">AIzaSyB-K6OiUDT_X0zp2jYjqHg54ThxEuZtr9I</string> | ||
| 2 | <string name="webview_permission_title">Demo App</string> | 3 | <string name="webview_permission_title">Demo App</string> |
| 3 | <string name="webview_permission_message">Το Demo App ζητάει πρόσβαση στην τοποθεσία σας.</string> | 4 | <string name="webview_permission_message">Το Demo App ζητάει πρόσβαση στην τοποθεσία σας.</string> |
| 4 | - <string name="lbl_ok">Οκ</string> | 5 | + <string name="lbl_ok">ΟΚ</string> |
| 5 | <string name="lbl_cancel">Άκυρο</string> | 6 | <string name="lbl_cancel">Άκυρο</string> |
| 7 | + <string name="lbl_stores">Καταστήματα συνεργάτη</string> | ||
| 8 | + <string name="lbl_no_shops">Δεν υπάρχουν καταστήματα συνεργάτη.</string> | ||
| 6 | <string name="welcome_user">User</string> | 9 | <string name="welcome_user">User</string> |
| 7 | <string name="menu_home">Αρχική</string> | 10 | <string name="menu_home">Αρχική</string> |
| 8 | <string name="demo_home">Αρχική οθόνη</string> | 11 | <string name="demo_home">Αρχική οθόνη</string> |
| ... | @@ -36,4 +39,6 @@ | ... | @@ -36,4 +39,6 @@ |
| 36 | <string name="demo_my_coupons_title">My coupons</string> | 39 | <string name="demo_my_coupons_title">My coupons</string> |
| 37 | <string name="demo_my_coupons_header">My Coupons</string> | 40 | <string name="demo_my_coupons_header">My Coupons</string> |
| 38 | <string name="demo_coupon_expired">Expired</string> | 41 | <string name="demo_coupon_expired">Expired</string> |
| 42 | + <string name="demo_partners_title">Partner businesses</string> | ||
| 43 | + <string name="demo_search_title">Αναζήτηση</string> | ||
| 39 | </resources> | 44 | </resources> | ... | ... |
-
Please register or login to post a comment