Showing
22 changed files
with
669 additions
and
3 deletions
... | @@ -35,7 +35,7 @@ PushIcon=ic_notify | ... | @@ -35,7 +35,7 @@ PushIcon=ic_notify |
35 | SendPackages=false | 35 | SendPackages=false |
36 | 36 | ||
37 | # The app language | 37 | # The app language |
38 | -#Language=el | 38 | +Language=el |
39 | 39 | ||
40 | # The merchant id for some requests | 40 | # The merchant id for some requests |
41 | MerchantId=59949 | 41 | MerchantId=59949 | ... | ... |
... | @@ -53,6 +53,7 @@ dependencies { | ... | @@ -53,6 +53,7 @@ dependencies { |
53 | api 'org.altbeacon:android-beacon-library:2.19.3' | 53 | api 'org.altbeacon:android-beacon-library:2.19.3' |
54 | api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' | 54 | api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' |
55 | api "commons-logging:commons-logging:1.2" | 55 | api "commons-logging:commons-logging:1.2" |
56 | + api group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.2.21' | ||
56 | 57 | ||
57 | //------------------------------ Firebase -----------------------------// | 58 | //------------------------------ Firebase -----------------------------// |
58 | api platform('com.google.firebase:firebase-bom:32.0.0') | 59 | api platform('com.google.firebase:firebase-bom:32.0.0') |
... | @@ -61,6 +62,8 @@ dependencies { | ... | @@ -61,6 +62,8 @@ dependencies { |
61 | //------------------------------ GMS -----------------------------// | 62 | //------------------------------ GMS -----------------------------// |
62 | api 'com.google.android.gms:play-services-base:18.2.0' | 63 | api 'com.google.android.gms:play-services-base:18.2.0' |
63 | api 'com.google.android.gms:play-services-location:21.0.1' | 64 | api 'com.google.android.gms:play-services-location:21.0.1' |
65 | + implementation 'com.google.android.gms:play-services-maps:18.2.0' | ||
66 | + implementation 'com.google.maps.android:android-maps-utils:3.8.2' | ||
64 | 67 | ||
65 | //------------------------------ Work Manager -----------------------------// | 68 | //------------------------------ Work Manager -----------------------------// |
66 | api 'androidx.work:work-runtime:2.8.1' | 69 | api 'androidx.work:work-runtime:2.8.1' | ... | ... |
... | @@ -16,6 +16,10 @@ | ... | @@ -16,6 +16,10 @@ |
16 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | 16 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
17 | 17 | ||
18 | <application> | 18 | <application> |
19 | + <meta-data | ||
20 | + android:name="com.google.android.geo.API_KEY" | ||
21 | + android:value="AIzaSyB-K6OiUDT_X0zp2jYjqHg54ThxEuZtr9I" /> | ||
22 | + | ||
19 | <!-- For Huawei Push --> | 23 | <!-- For Huawei Push --> |
20 | <meta-data | 24 | <meta-data |
21 | android:name="push_kit_auto_init_enabled" | 25 | android:name="push_kit_auto_init_enabled" | ... | ... |
1 | package ly.warp.sdk.activities; | 1 | package ly.warp.sdk.activities; |
2 | 2 | ||
3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
4 | +import android.view.View; | ||
5 | +import android.widget.LinearLayout; | ||
6 | + | ||
7 | +import androidx.fragment.app.Fragment; | ||
8 | +import androidx.fragment.app.FragmentActivity; | ||
4 | 9 | ||
5 | import ly.warp.sdk.R; | 10 | import ly.warp.sdk.R; |
11 | +import ly.warp.sdk.fragments.CampainsFragment; | ||
12 | +import ly.warp.sdk.fragments.MapFragment; | ||
6 | 13 | ||
7 | -public class EurobankHomeActivity extends WarpBaseActivity { | 14 | +public class EurobankHomeActivity extends FragmentActivity implements View.OnClickListener { |
8 | 15 | ||
9 | // =========================================================== | 16 | // =========================================================== |
10 | // Constants | 17 | // Constants |
... | @@ -14,6 +21,9 @@ public class EurobankHomeActivity extends WarpBaseActivity { | ... | @@ -14,6 +21,9 @@ public class EurobankHomeActivity extends WarpBaseActivity { |
14 | // Fields | 21 | // Fields |
15 | // =========================================================== | 22 | // =========================================================== |
16 | 23 | ||
24 | + private Fragment mFragmentToSet = null; | ||
25 | + private LinearLayout mLlList, mLlMap; | ||
26 | + | ||
17 | // =========================================================== | 27 | // =========================================================== |
18 | // Methods for/from SuperClass/Interfaces | 28 | // Methods for/from SuperClass/Interfaces |
19 | // =========================================================== | 29 | // =========================================================== |
... | @@ -22,6 +32,12 @@ public class EurobankHomeActivity extends WarpBaseActivity { | ... | @@ -22,6 +32,12 @@ public class EurobankHomeActivity extends WarpBaseActivity { |
22 | public void onCreate(Bundle savedInstanceState) { | 32 | public void onCreate(Bundle savedInstanceState) { |
23 | super.onCreate(savedInstanceState); | 33 | super.onCreate(savedInstanceState); |
24 | setContentView(R.layout.activity_eurobank_home); | 34 | setContentView(R.layout.activity_eurobank_home); |
35 | + mLlList = findViewById(R.id.ll_filter_list); | ||
36 | + mLlMap = findViewById(R.id.ll_filter_map); | ||
37 | + | ||
38 | + mLlList.setOnClickListener(this); | ||
39 | + mLlMap.setOnClickListener(this); | ||
40 | + | ||
25 | initViews(); | 41 | initViews(); |
26 | } | 42 | } |
27 | 43 | ||
... | @@ -31,8 +47,36 @@ public class EurobankHomeActivity extends WarpBaseActivity { | ... | @@ -31,8 +47,36 @@ public class EurobankHomeActivity extends WarpBaseActivity { |
31 | } | 47 | } |
32 | 48 | ||
33 | private void initViews() { | 49 | private void initViews() { |
50 | + mLlList.setVisibility(View.VISIBLE); | ||
51 | + mLlMap.setVisibility(View.GONE); | ||
52 | + | ||
53 | + mFragmentToSet = CampainsFragment.newInstance(); | ||
54 | + getSupportFragmentManager().beginTransaction().add(R.id.fl_fragment, mFragmentToSet).commit(); | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public void onClick(View view) { | ||
59 | + if (view.getId() == R.id.ll_filter_list) { | ||
60 | + mLlList.setVisibility(View.GONE); | ||
61 | + mLlMap.setVisibility(View.VISIBLE); | ||
34 | 62 | ||
63 | + mFragmentToSet = MapFragment.newInstance(); | ||
64 | + getSupportFragmentManager().beginTransaction() | ||
65 | + .replace(R.id.fl_fragment, mFragmentToSet) | ||
66 | + .addToBackStack(null) | ||
67 | + .commit(); | ||
68 | + return; | ||
69 | + } | ||
70 | + if (view.getId() == R.id.ll_filter_map) { | ||
71 | + mLlList.setVisibility(View.VISIBLE); | ||
72 | + mLlMap.setVisibility(View.GONE); | ||
35 | 73 | ||
74 | + mFragmentToSet = CampainsFragment.newInstance(); | ||
75 | + getSupportFragmentManager().beginTransaction() | ||
76 | + .replace(R.id.fl_fragment, mFragmentToSet) | ||
77 | + .addToBackStack(null) | ||
78 | + .commit(); | ||
79 | + } | ||
36 | } | 80 | } |
37 | 81 | ||
38 | // =========================================================== | 82 | // =========================================================== | ... | ... |
1 | +package ly.warp.sdk.fragments; | ||
2 | + | ||
3 | +import android.os.Bundle; | ||
4 | +import android.view.LayoutInflater; | ||
5 | +import android.view.View; | ||
6 | +import android.view.ViewGroup; | ||
7 | + | ||
8 | +import androidx.annotation.NonNull; | ||
9 | +import androidx.fragment.app.Fragment; | ||
10 | +import androidx.recyclerview.widget.LinearLayoutManager; | ||
11 | +import androidx.recyclerview.widget.RecyclerView; | ||
12 | + | ||
13 | +import ly.warp.sdk.R; | ||
14 | +import ly.warp.sdk.activities.WarpViewActivity; | ||
15 | +import ly.warp.sdk.utils.WarplyManagerHelper; | ||
16 | +import ly.warp.sdk.views.adapters.ActiveCampaignsAdapter; | ||
17 | + | ||
18 | +public class CampainsFragment extends Fragment { | ||
19 | + | ||
20 | + public static Fragment newInstance() { | ||
21 | + CampainsFragment campaignsFragment = new CampainsFragment(); | ||
22 | + return campaignsFragment; | ||
23 | + } | ||
24 | + | ||
25 | + @Override | ||
26 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
27 | + return inflater.inflate(R.layout.fragment_campaigns, container, false); | ||
28 | + } | ||
29 | + | ||
30 | + public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { | ||
31 | + super.onViewCreated(view, savedInstanceState); | ||
32 | + RecyclerView mRecyclerCampaigns = view.findViewById(R.id.rv_active_campaigns); | ||
33 | + | ||
34 | + mRecyclerCampaigns.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); | ||
35 | + ActiveCampaignsAdapter mAdapterCampaigns = new ActiveCampaignsAdapter(getContext(), WarplyManagerHelper.getCampaignList()); | ||
36 | + mRecyclerCampaigns.setAdapter(mAdapterCampaigns); | ||
37 | + mAdapterCampaigns.getPositionClicks() | ||
38 | + .doOnNext(campaignItem -> { | ||
39 | + startActivity(WarpViewActivity.createIntentFromURL(getContext(), campaignItem.getIndexUrl())); | ||
40 | + }) | ||
41 | + .doOnError(error -> { | ||
42 | + }) | ||
43 | + .subscribe(); | ||
44 | + } | ||
45 | + | ||
46 | + @Override | ||
47 | + public void onDestroyView() { | ||
48 | + super.onDestroyView(); | ||
49 | + } | ||
50 | +} |
1 | +package ly.warp.sdk.fragments; | ||
2 | + | ||
3 | +import android.graphics.Bitmap; | ||
4 | +import android.graphics.Canvas; | ||
5 | +import android.graphics.drawable.Drawable; | ||
6 | +import android.os.Bundle; | ||
7 | +import android.view.LayoutInflater; | ||
8 | +import android.view.View; | ||
9 | +import android.view.ViewGroup; | ||
10 | + | ||
11 | +import androidx.annotation.NonNull; | ||
12 | +import androidx.core.content.ContextCompat; | ||
13 | +import androidx.fragment.app.Fragment; | ||
14 | + | ||
15 | +import com.google.android.gms.maps.CameraUpdate; | ||
16 | +import com.google.android.gms.maps.CameraUpdateFactory; | ||
17 | +import com.google.android.gms.maps.GoogleMap; | ||
18 | +import com.google.android.gms.maps.OnMapReadyCallback; | ||
19 | +import com.google.android.gms.maps.SupportMapFragment; | ||
20 | +import com.google.android.gms.maps.model.BitmapDescriptor; | ||
21 | +import com.google.android.gms.maps.model.BitmapDescriptorFactory; | ||
22 | +import com.google.android.gms.maps.model.LatLng; | ||
23 | +import com.google.android.gms.maps.model.MarkerOptions; | ||
24 | +import com.google.android.gms.maps.model.VisibleRegion; | ||
25 | + | ||
26 | +import java.util.ArrayList; | ||
27 | +import java.util.Random; | ||
28 | + | ||
29 | +import ly.warp.sdk.R; | ||
30 | +import ly.warp.sdk.utils.constants.WarpConstants; | ||
31 | + | ||
32 | +public class MapFragment extends Fragment implements OnMapReadyCallback, | ||
33 | + GoogleMap.OnMapLoadedCallback, GoogleMap.OnCameraIdleListener { | ||
34 | + public final static float DEFAULT_LOCATION_ZOOM = 6.2f; | ||
35 | + private static final double MIN_LATITUDE = 34.75261; | ||
36 | + private static final double MAX_LATITUDE = 41.97761; | ||
37 | + private static final double MIN_LONGITUDE = 19.33079; | ||
38 | + private static final double MAX_LONGITUDE = 28.62522; | ||
39 | + private SupportMapFragment mMapView; | ||
40 | + private GoogleMap mMap; | ||
41 | + | ||
42 | + public static Fragment newInstance() { | ||
43 | + MapFragment mapFragment = new MapFragment(); | ||
44 | + return mapFragment; | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
49 | + super.onCreateView(inflater, container, savedInstanceState); | ||
50 | + return inflater.inflate(R.layout.fragment_map, container, false); | ||
51 | + } | ||
52 | + | ||
53 | + public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { | ||
54 | + super.onViewCreated(view, savedInstanceState); | ||
55 | + | ||
56 | + mMapView = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.mv_shops); | ||
57 | + mMapView.getMapAsync(this); | ||
58 | + } | ||
59 | + | ||
60 | + @Override | ||
61 | + public void onDestroyView() { | ||
62 | + super.onDestroyView(); | ||
63 | + } | ||
64 | + | ||
65 | + @Override | ||
66 | + public void onMapReady(@NonNull GoogleMap googleMap) { | ||
67 | + mMap = googleMap; | ||
68 | + mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); | ||
69 | + mMap.setMinZoomPreference(DEFAULT_LOCATION_ZOOM); | ||
70 | + mMap.setLatLngBoundsForCameraTarget(WarpConstants.GREECE_BOUNDS); | ||
71 | + mMap.getUiSettings().setZoomControlsEnabled(true); | ||
72 | + mMap.getUiSettings().setZoomGesturesEnabled(true); | ||
73 | + mMap.getUiSettings().setCompassEnabled(false); | ||
74 | + mMap.getUiSettings().setMyLocationButtonEnabled(false); | ||
75 | + mMap.getUiSettings().setMapToolbarEnabled(false); | ||
76 | + mMap.getUiSettings().setTiltGesturesEnabled(false); | ||
77 | + mMap.getUiSettings().setRotateGesturesEnabled(false); | ||
78 | + mMap.setOnMapLoadedCallback(this); | ||
79 | + mMap.setOnCameraIdleListener(this); | ||
80 | + } | ||
81 | + | ||
82 | + @Override | ||
83 | + public void onMapLoaded() { | ||
84 | + if (mMap != null) { | ||
85 | + CameraUpdate camUpdate; | ||
86 | + camUpdate = CameraUpdateFactory.newLatLngBounds(WarpConstants.GREECE_BOUNDS, 48); | ||
87 | + mMap.animateCamera(camUpdate); | ||
88 | + | ||
89 | + ArrayList<LatLng> generatedLatLngList = generateRandomLatLng(10); | ||
90 | + addCustomMarkersToMap(generatedLatLngList); | ||
91 | + } | ||
92 | + } | ||
93 | + | ||
94 | + @Override | ||
95 | + public void onCameraIdle() { | ||
96 | + // Get the current visible region on the map | ||
97 | + VisibleRegion visibleRegion = mMap.getProjection().getVisibleRegion(); | ||
98 | + | ||
99 | + // Generate new random LatLng points based on the visible region | ||
100 | + ArrayList<LatLng> generatedLatLngList = generateRandomLatLng(10, visibleRegion); | ||
101 | + | ||
102 | + // Clear existing markers on the map | ||
103 | + mMap.clear(); | ||
104 | + | ||
105 | + // Add new markers to the map | ||
106 | + addCustomMarkersToMap(generatedLatLngList); | ||
107 | + } | ||
108 | + | ||
109 | + private void addCustomMarkersToMap(ArrayList<LatLng> generatedLatLngList) { | ||
110 | + BitmapDescriptor customMarkerIcon = getBitmapDescriptorFromDrawable(ContextCompat.getDrawable(getContext(), R.drawable.map_pin)); | ||
111 | + for (LatLng pin : generatedLatLngList) { | ||
112 | + mMap.addMarker(new MarkerOptions() | ||
113 | + .position(pin) | ||
114 | + .anchor(0.5f, 0.5f) | ||
115 | + .title(getString(R.string.eurobank_pin_name)) | ||
116 | + .icon(customMarkerIcon) | ||
117 | + .snippet(String.valueOf(Math.random()))); | ||
118 | + } | ||
119 | + } | ||
120 | + | ||
121 | + private ArrayList<LatLng> generateRandomLatLng(int count) { | ||
122 | + ArrayList<LatLng> latLngList = new ArrayList<>(); | ||
123 | + Random random = new Random(); | ||
124 | + | ||
125 | + for (int i = 0; i < count; i++) { | ||
126 | + double latitude = MIN_LATITUDE + (MAX_LATITUDE - MIN_LATITUDE) * random.nextDouble(); | ||
127 | + double longitude = MIN_LONGITUDE + (MAX_LONGITUDE - MIN_LONGITUDE) * random.nextDouble(); | ||
128 | + latLngList.add(new LatLng(latitude, longitude)); | ||
129 | + } | ||
130 | + | ||
131 | + return latLngList; | ||
132 | + } | ||
133 | + | ||
134 | + private ArrayList<LatLng> generateRandomLatLng(int count, VisibleRegion visibleRegion) { | ||
135 | + ArrayList<LatLng> latLngList = new ArrayList<>(); | ||
136 | + Random random = new Random(); | ||
137 | + | ||
138 | + for (int i = 0; i < count; i++) { | ||
139 | + double latitude = visibleRegion.latLngBounds.southwest.latitude + | ||
140 | + (visibleRegion.latLngBounds.northeast.latitude - visibleRegion.latLngBounds.southwest.latitude) * random.nextDouble(); | ||
141 | + | ||
142 | + double longitude = visibleRegion.latLngBounds.southwest.longitude + | ||
143 | + (visibleRegion.latLngBounds.northeast.longitude - visibleRegion.latLngBounds.southwest.longitude) * random.nextDouble(); | ||
144 | + | ||
145 | + latLngList.add(new LatLng(latitude, longitude)); | ||
146 | + } | ||
147 | + | ||
148 | + return latLngList; | ||
149 | + } | ||
150 | + | ||
151 | + private BitmapDescriptor getBitmapDescriptorFromDrawable(Drawable drawable) { | ||
152 | + Canvas canvas = new Canvas(); | ||
153 | + Bitmap bitmap = Bitmap.createBitmap(160, 140, Bitmap.Config.ARGB_8888); | ||
154 | + canvas.setBitmap(bitmap); | ||
155 | + drawable.setBounds(0, 0, 160, 140); | ||
156 | + drawable.draw(canvas); | ||
157 | + | ||
158 | + return BitmapDescriptorFactory.fromBitmap(bitmap); | ||
159 | + } | ||
160 | +} |
... | @@ -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 | /** |
... | @@ -32,6 +35,12 @@ public class WarpConstants { | ... | @@ -32,6 +35,12 @@ public class WarpConstants { |
32 | */ | 35 | */ |
33 | public static final String SDK_VERSION = "4.5.5.4"; | 36 | public static final String SDK_VERSION = "4.5.5.4"; |
34 | 37 | ||
38 | + | ||
39 | + public static final LatLngBounds GREECE_BOUNDS = new LatLngBounds( | ||
40 | + new LatLng(34.75261, 19.33079), | ||
41 | + new LatLng(41.97761, 28.62522) | ||
42 | + ); | ||
43 | + | ||
35 | /** | 44 | /** |
36 | * The URL of the server where it should ping | 45 | * The URL of the server where it should ping |
37 | */ | 46 | */ | ... | ... |
1 | +package ly.warp.sdk.views.adapters; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.text.TextUtils; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.ImageView; | ||
9 | +import android.widget.TextView; | ||
10 | + | ||
11 | +import androidx.recyclerview.widget.RecyclerView; | ||
12 | + | ||
13 | +import com.bumptech.glide.Glide; | ||
14 | +import com.bumptech.glide.load.engine.DiskCacheStrategy; | ||
15 | + | ||
16 | +import java.util.ArrayList; | ||
17 | + | ||
18 | +import io.reactivex.Observable; | ||
19 | +import io.reactivex.subjects.PublishSubject; | ||
20 | +import ly.warp.sdk.R; | ||
21 | +import ly.warp.sdk.io.models.Campaign; | ||
22 | + | ||
23 | +public class ActiveCampaignsAdapter extends RecyclerView.Adapter<ActiveCampaignsAdapter.ActiveCampaignsViewHolder> { | ||
24 | + private Context mContext; | ||
25 | + private ArrayList<Campaign> mCampaigns; | ||
26 | + private final PublishSubject<Campaign> onClickSubject = PublishSubject.create(); | ||
27 | + | ||
28 | + public ActiveCampaignsAdapter(Context mContext, ArrayList<Campaign> campaignList) { | ||
29 | + this.mContext = mContext; | ||
30 | + this.mCampaigns = campaignList; | ||
31 | + } | ||
32 | + | ||
33 | + public class ActiveCampaignsViewHolder extends RecyclerView.ViewHolder { | ||
34 | + private ImageView mIvCampaignImage; | ||
35 | + private TextView mTvCampaignTitle, mTvCampaignSubtitle; | ||
36 | + | ||
37 | + public ActiveCampaignsViewHolder(View view) { | ||
38 | + super(view); | ||
39 | + mIvCampaignImage = view.findViewById(R.id.iv_campaign_image); | ||
40 | + mTvCampaignTitle = view.findViewById(R.id.tv_campaign_title); | ||
41 | + mTvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle); | ||
42 | + } | ||
43 | + } | ||
44 | + | ||
45 | + @Override | ||
46 | + public int getItemCount() { | ||
47 | + if (mCampaigns == null) | ||
48 | + return 0; | ||
49 | + else | ||
50 | + return mCampaigns.size(); | ||
51 | + } | ||
52 | + | ||
53 | + public Campaign getItem(int id) { | ||
54 | + return mCampaigns.get(id); | ||
55 | + } | ||
56 | + | ||
57 | + public void updateData(ArrayList<Campaign> campaignList) { | ||
58 | + mCampaigns.clear(); | ||
59 | + mCampaigns.addAll(campaignList); | ||
60 | + notifyDataSetChanged(); | ||
61 | + } | ||
62 | + | ||
63 | + @Override | ||
64 | + public ActiveCampaignsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
65 | + View itemView; | ||
66 | + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_campaign_layout, parent, false); | ||
67 | + return new ActiveCampaignsViewHolder(itemView); | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
71 | + public void onBindViewHolder(final ActiveCampaignsViewHolder holder, int position) { | ||
72 | + Campaign campaignItem = mCampaigns.get(position); | ||
73 | + | ||
74 | + holder.mTvCampaignTitle.setText(campaignItem.getTitle()); | ||
75 | + holder.mTvCampaignSubtitle.setText(campaignItem.getSubtitle()); | ||
76 | + | ||
77 | + if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) { | ||
78 | + Glide.with(mContext) | ||
79 | + .load(campaignItem.getLogoUrl()) | ||
80 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
81 | + .into(holder.mIvCampaignImage); | ||
82 | + } | ||
83 | + | ||
84 | + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem)); | ||
85 | + } | ||
86 | + | ||
87 | + public Observable<Campaign> getPositionClicks() { | ||
88 | + return onClickSubject.cache(); | ||
89 | + } | ||
90 | +} |
18.6 KB
1.28 KB
3.11 KB
15.3 KB
82.7 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item> | ||
4 | + <shape android:shape="rectangle"> | ||
5 | + <solid android:color="@color/red2" /> <!-- border color --> | ||
6 | + </shape> | ||
7 | + </item> | ||
8 | + | ||
9 | + <item | ||
10 | + android:bottom="4dp"> <!-- adjust borders width here --> | ||
11 | + <shape android:shape="rectangle"> | ||
12 | + <solid android:color="#FFFFFF" /> <!-- background color --> | ||
13 | + </shape> | ||
14 | + </item> | ||
15 | +</layer-list> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <solid android:color="@android:color/white" /> | ||
4 | + <corners android:radius="5dp" /> | ||
5 | + <padding | ||
6 | + android:bottom="0dp" | ||
7 | + android:left="0dp" | ||
8 | + android:right="0dp" | ||
9 | + android:top="0dp" /> | ||
10 | +</shape> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <solid android:color="@color/red2" /> | ||
4 | + <corners android:radius="23dp" /> | ||
5 | + <padding | ||
6 | + android:bottom="0dp" | ||
7 | + android:left="0dp" | ||
8 | + android:right="0dp" | ||
9 | + android:top="0dp" /> | ||
10 | +</shape> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="260dp" | ||
7 | + android:background="@drawable/background_rounded_corners" | ||
8 | + android:clipToOutline="true" | ||
9 | + android:layout_marginBottom="16dp"> | ||
10 | + | ||
11 | + <androidx.constraintlayout.widget.Guideline | ||
12 | + android:id="@+id/gl_horizontal_84_percent" | ||
13 | + android:layout_width="wrap_content" | ||
14 | + android:layout_height="wrap_content" | ||
15 | + android:orientation="horizontal" | ||
16 | + app:layout_constraintGuide_percent="0.84" /> | ||
17 | + | ||
18 | + <ImageView | ||
19 | + android:id="@+id/iv_campaign_image" | ||
20 | + android:layout_width="match_parent" | ||
21 | + android:layout_height="170dp" | ||
22 | + android:scaleType="centerCrop" | ||
23 | + app:layout_constraintEnd_toEndOf="parent" | ||
24 | + app:layout_constraintStart_toStartOf="parent" | ||
25 | + app:layout_constraintTop_toTopOf="parent" /> | ||
26 | + | ||
27 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
28 | + android:layout_width="match_parent" | ||
29 | + android:layout_height="0dp" | ||
30 | + android:background="@android:color/white" | ||
31 | + app:layout_constraintBottom_toBottomOf="parent" | ||
32 | + app:layout_constraintEnd_toEndOf="parent" | ||
33 | + app:layout_constraintStart_toStartOf="parent" | ||
34 | + app:layout_constraintTop_toBottomOf="@+id/iv_campaign_image"> | ||
35 | + | ||
36 | + <LinearLayout | ||
37 | + android:layout_width="match_parent" | ||
38 | + android:layout_height="match_parent" | ||
39 | + android:background="@android:color/white" | ||
40 | + android:gravity="center_vertical" | ||
41 | + android:orientation="vertical" | ||
42 | + android:paddingHorizontal="24dp"> | ||
43 | + | ||
44 | + <TextView | ||
45 | + android:id="@+id/tv_campaign_title" | ||
46 | + android:layout_width="wrap_content" | ||
47 | + android:layout_height="wrap_content" | ||
48 | + android:layout_marginBottom="2dp" | ||
49 | + android:maxLines="2" | ||
50 | + android:textStyle="bold" | ||
51 | + tools:text="Test Title" /> | ||
52 | + | ||
53 | + <TextView | ||
54 | + android:id="@+id/tv_campaign_subtitle" | ||
55 | + android:layout_width="wrap_content" | ||
56 | + android:layout_height="wrap_content" | ||
57 | + android:layout_marginTop="2dp" | ||
58 | + android:maxLines="2" | ||
59 | + tools:text="Test Subtitle" /> | ||
60 | + </LinearLayout> | ||
61 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
62 | + | ||
63 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
64 | + android:layout_width="100dp" | ||
65 | + android:layout_height="90dp" | ||
66 | + app:layout_constraintBottom_toTopOf="@+id/gl_horizontal_84_percent" | ||
67 | + app:layout_constraintEnd_toEndOf="parent"> | ||
68 | + | ||
69 | + <androidx.constraintlayout.widget.Guideline | ||
70 | + android:id="@+id/gl_horizontal_26_percent_inner" | ||
71 | + android:layout_width="wrap_content" | ||
72 | + android:layout_height="wrap_content" | ||
73 | + android:orientation="horizontal" | ||
74 | + app:layout_constraintGuide_percent="0.26" /> | ||
75 | + | ||
76 | + <androidx.constraintlayout.widget.Guideline | ||
77 | + android:id="@+id/gl_horizontal_76_percent_inner" | ||
78 | + android:layout_width="wrap_content" | ||
79 | + android:layout_height="wrap_content" | ||
80 | + android:orientation="horizontal" | ||
81 | + app:layout_constraintGuide_percent="0.76" /> | ||
82 | + | ||
83 | + <ImageView | ||
84 | + android:layout_width="100dp" | ||
85 | + android:layout_height="90dp" | ||
86 | + android:src="@drawable/offer_circle_orange" | ||
87 | + app:layout_constraintBottom_toBottomOf="parent" | ||
88 | + app:layout_constraintEnd_toEndOf="parent" | ||
89 | + app:layout_constraintStart_toStartOf="parent" | ||
90 | + app:layout_constraintTop_toTopOf="parent" /> | ||
91 | + | ||
92 | + <ImageView | ||
93 | + android:layout_width="24dp" | ||
94 | + android:layout_height="24dp" | ||
95 | + android:src="@drawable/epistrofi_logo_white" | ||
96 | + app:layout_constraintEnd_toEndOf="parent" | ||
97 | + app:layout_constraintStart_toStartOf="parent" | ||
98 | + app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_26_percent_inner" /> | ||
99 | + | ||
100 | + <TextView | ||
101 | + android:id="@+id/tv_campaign_value" | ||
102 | + android:layout_width="wrap_content" | ||
103 | + android:layout_height="wrap_content" | ||
104 | + android:layout_marginBottom="2dp" | ||
105 | + android:maxLines="1" | ||
106 | + android:textStyle="bold" | ||
107 | + android:textColor="@android:color/white" | ||
108 | + app:layout_constraintBottom_toTopOf="@+id/gl_horizontal_76_percent_inner" | ||
109 | + app:layout_constraintEnd_toEndOf="parent" | ||
110 | + app:layout_constraintStart_toStartOf="parent" | ||
111 | + android:text="10%" /> | ||
112 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
113 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | xmlns:app="http://schemas.android.com/apk/res-auto" | 2 | xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
3 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
5 | android:background="@color/grey"> | 6 | android:background="@color/grey"> |
6 | 7 | ||
7 | <androidx.constraintlayout.widget.ConstraintLayout | 8 | <androidx.constraintlayout.widget.ConstraintLayout |
9 | + android:id="@+id/cl_header" | ||
8 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
9 | android:layout_height="120dp" | 11 | android:layout_height="120dp" |
10 | android:background="@drawable/background_gradient" | 12 | android:background="@drawable/background_gradient" |
... | @@ -13,10 +15,131 @@ | ... | @@ -13,10 +15,131 @@ |
13 | <ImageView | 15 | <ImageView |
14 | android:layout_width="180dp" | 16 | android:layout_width="180dp" |
15 | android:layout_height="60dp" | 17 | android:layout_height="60dp" |
18 | + android:layout_marginHorizontal="24dp" | ||
16 | android:src="@drawable/logo" | 19 | android:src="@drawable/logo" |
17 | app:layout_constraintBottom_toBottomOf="parent" | 20 | app:layout_constraintBottom_toBottomOf="parent" |
18 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
19 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
20 | - | ||
21 | </androidx.constraintlayout.widget.ConstraintLayout> | 23 | </androidx.constraintlayout.widget.ConstraintLayout> |
24 | + | ||
25 | + <LinearLayout | ||
26 | + android:id="@+id/ll_filters_list" | ||
27 | + android:layout_width="match_parent" | ||
28 | + android:layout_height="70dp" | ||
29 | + android:layout_below="@+id/cl_header" | ||
30 | + android:background="@android:color/white" | ||
31 | + android:gravity="center_vertical" | ||
32 | + android:orientation="horizontal" | ||
33 | + android:paddingHorizontal="24dp"> | ||
34 | + | ||
35 | + <LinearLayout | ||
36 | + android:id="@+id/ll_filter_list" | ||
37 | + android:layout_width="100dp" | ||
38 | + android:layout_height="40dp" | ||
39 | + android:background="@drawable/background_rounded_corners_red" | ||
40 | + android:gravity="center" | ||
41 | + android:orientation="horizontal" | ||
42 | + android:visibility="gone" | ||
43 | + tools:visibility="visible"> | ||
44 | + | ||
45 | + <ImageView | ||
46 | + android:layout_width="16dp" | ||
47 | + android:layout_height="16dp" | ||
48 | + android:layout_marginEnd="4dp" | ||
49 | + android:src="@drawable/list" /> | ||
50 | + | ||
51 | + <TextView | ||
52 | + android:layout_width="wrap_content" | ||
53 | + android:layout_height="wrap_content" | ||
54 | + android:layout_marginStart="4dp" | ||
55 | + android:text="@string/eurobank_list" | ||
56 | + android:textColor="@android:color/white" | ||
57 | + android:textSize="18sp" /> | ||
58 | + </LinearLayout> | ||
59 | + | ||
60 | + <LinearLayout | ||
61 | + android:id="@+id/ll_filter_map" | ||
62 | + android:layout_width="100dp" | ||
63 | + android:layout_height="40dp" | ||
64 | + android:background="@drawable/background_rounded_corners_red" | ||
65 | + android:gravity="center" | ||
66 | + android:orientation="horizontal" | ||
67 | + android:visibility="gone" | ||
68 | + tools:visibility="gone"> | ||
69 | + | ||
70 | + <ImageView | ||
71 | + android:layout_width="20dp" | ||
72 | + android:layout_height="20dp" | ||
73 | + android:src="@drawable/map" /> | ||
74 | + | ||
75 | + <TextView | ||
76 | + android:layout_width="wrap_content" | ||
77 | + android:layout_height="wrap_content" | ||
78 | + android:layout_marginStart="4dp" | ||
79 | + android:text="@string/eurobank_map" | ||
80 | + android:textColor="@android:color/white" | ||
81 | + android:textSize="18sp" /> | ||
82 | + </LinearLayout> | ||
83 | + | ||
84 | + <LinearLayout | ||
85 | + android:layout_width="wrap_content" | ||
86 | + android:layout_height="40dp" | ||
87 | + android:layout_marginStart="16dp" | ||
88 | + android:background="@drawable/background_bottom_border" | ||
89 | + android:gravity="center" | ||
90 | + android:orientation="horizontal"> | ||
91 | + | ||
92 | + <TextView | ||
93 | + android:layout_width="wrap_content" | ||
94 | + android:layout_height="wrap_content" | ||
95 | + android:layout_marginStart="4dp" | ||
96 | + android:text="@string/eurobank_filter_all" | ||
97 | + android:textColor="@color/grey_dark" | ||
98 | + android:textSize="18sp" | ||
99 | + android:textStyle="bold" /> | ||
100 | + </LinearLayout> | ||
101 | + | ||
102 | + <LinearLayout | ||
103 | + android:layout_width="wrap_content" | ||
104 | + android:layout_height="40dp" | ||
105 | + android:layout_marginStart="16dp" | ||
106 | + android:gravity="center" | ||
107 | + android:orientation="horizontal"> | ||
108 | + | ||
109 | + <TextView | ||
110 | + android:layout_width="wrap_content" | ||
111 | + android:layout_height="wrap_content" | ||
112 | + android:layout_marginStart="4dp" | ||
113 | + android:text="@string/eurobank_filter_home" | ||
114 | + android:textColor="@color/grey_light" | ||
115 | + android:textSize="18sp" | ||
116 | + android:textStyle="bold" /> | ||
117 | + </LinearLayout> | ||
118 | + | ||
119 | + <LinearLayout | ||
120 | + android:layout_width="wrap_content" | ||
121 | + android:layout_height="40dp" | ||
122 | + android:layout_marginStart="16dp" | ||
123 | + android:gravity="center" | ||
124 | + android:orientation="horizontal"> | ||
125 | + | ||
126 | + <TextView | ||
127 | + android:layout_width="wrap_content" | ||
128 | + android:layout_height="wrap_content" | ||
129 | + android:layout_marginStart="4dp" | ||
130 | + android:text="@string/eurobank_filter_health" | ||
131 | + android:textColor="@color/grey_light" | ||
132 | + android:textSize="18sp" | ||
133 | + android:textStyle="bold" /> | ||
134 | + </LinearLayout> | ||
135 | + </LinearLayout> | ||
136 | + | ||
137 | + <FrameLayout | ||
138 | + android:id="@+id/fl_fragment" | ||
139 | + android:layout_width="match_parent" | ||
140 | + android:layout_height="match_parent" | ||
141 | + android:layout_below="@+id/ll_filters_list" | ||
142 | + app:layout_constraintEnd_toEndOf="parent" | ||
143 | + app:layout_constraintStart_toStartOf="parent" | ||
144 | + app:layout_constraintTop_toTopOf="parent" /> | ||
22 | </RelativeLayout> | 145 | </RelativeLayout> | ... | ... |
1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + android:layout_width="match_parent" | ||
3 | + android:layout_height="match_parent"> | ||
4 | + | ||
5 | + <androidx.recyclerview.widget.RecyclerView | ||
6 | + android:id="@+id/rv_active_campaigns" | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="wrap_content" | ||
9 | + android:clipToPadding="false" | ||
10 | + android:orientation="vertical" | ||
11 | + android:overScrollMode="never" | ||
12 | + android:paddingVertical="16dp" | ||
13 | + android:layout_marginHorizontal="16dp" | ||
14 | + android:scrollbars="none" /> | ||
15 | +</RelativeLayout> |
1 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + android:layout_width="match_parent" | ||
3 | + android:layout_height="match_parent"> | ||
4 | + | ||
5 | + <fragment | ||
6 | + android:id="@+id/mv_shops" | ||
7 | + class="com.google.android.gms.maps.SupportMapFragment" | ||
8 | + android:layout_width="match_parent" | ||
9 | + android:layout_height="match_parent" /> | ||
10 | +</FrameLayout> |
... | @@ -6,4 +6,8 @@ | ... | @@ -6,4 +6,8 @@ |
6 | <color name="grey">#E7EAEB</color> | 6 | <color name="grey">#E7EAEB</color> |
7 | <color name="blue_dark">#081748</color> | 7 | <color name="blue_dark">#081748</color> |
8 | <color name="blue">#204EAC</color> | 8 | <color name="blue">#204EAC</color> |
9 | + <color name="red">#EA002A</color> | ||
10 | + <color name="grey_dark">#484848</color> | ||
11 | + <color name="red2">#E8002A</color> | ||
12 | + <color name="grey_light">#D3D3D3</color> | ||
9 | </resources> | 13 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,4 +4,10 @@ | ... | @@ -4,4 +4,10 @@ |
4 | <string name="rate_dialog_positive">Rate Now</string> | 4 | <string name="rate_dialog_positive">Rate Now</string> |
5 | <string name="rate_diloag_neutral">Remind Me Later</string> | 5 | <string name="rate_diloag_neutral">Remind Me Later</string> |
6 | <string name="rate_dialog_negative">No, Thanks</string> | 6 | <string name="rate_dialog_negative">No, Thanks</string> |
7 | + <string name="eurobank_list">Λίστα</string> | ||
8 | + <string name="eurobank_map">Χάρτης</string> | ||
9 | + <string name="eurobank_filter_all">Όλα</string> | ||
10 | + <string name="eurobank_filter_home">Σπίτι</string> | ||
11 | + <string name="eurobank_filter_health">Υγεία</string> | ||
12 | + <string name="eurobank_pin_name">Test Pin</string> | ||
7 | </resources> | 13 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment