Showing
73 changed files
with
858 additions
and
97 deletions
... | @@ -18,7 +18,8 @@ | ... | @@ -18,7 +18,8 @@ |
18 | android:extractNativeLibs="true" | 18 | android:extractNativeLibs="true" |
19 | android:fullBackupContent="false" | 19 | android:fullBackupContent="false" |
20 | android:hardwareAccelerated="true" | 20 | android:hardwareAccelerated="true" |
21 | - android:icon="@drawable/ic_notification_logo" | 21 | + android:icon="@mipmap/ic_launcher" |
22 | + android:roundIcon="@mipmap/ic_launcher_round" | ||
22 | android:installLocation="internalOnly" | 23 | android:installLocation="internalOnly" |
23 | android:label="@string/app_name" | 24 | android:label="@string/app_name" |
24 | android:largeHeap="true" | 25 | android:largeHeap="true" | ... | ... |
1 | # {@link ly.warp.sdk.utils.WarplyProperty} | 1 | # {@link ly.warp.sdk.utils.WarplyProperty} |
2 | 2 | ||
3 | # The app uuid the warply sdk need to connect to the engage server | 3 | # The app uuid the warply sdk need to connect to the engage server |
4 | -Uuid= | 4 | +# cosmote demo app f83dfde1145e4c2da69793abb2f579af |
5 | +Uuid=f83dfde1145e4c2da69793abb2f579af | ||
5 | 6 | ||
6 | # If we need to see logs in Logcat | 7 | # If we need to see logs in Logcat |
7 | -Debug=false | 8 | +Debug=true |
8 | 9 | ||
9 | # Production or Development environment of the engage server | 10 | # Production or Development environment of the engage server |
10 | # Production: https://engage.warp.ly | 11 | # Production: https://engage.warp.ly |
... | @@ -41,7 +42,7 @@ MerchantId=20113 | ... | @@ -41,7 +42,7 @@ MerchantId=20113 |
41 | 42 | ||
42 | # The login type must be one of the below: | 43 | # The login type must be one of the below: |
43 | # email, msisdn, username | 44 | # email, msisdn, username |
44 | -LoginType=email | 45 | +LoginType=msisdn |
45 | 46 | ||
46 | # The deeplink url scheme for react native campaigns: | 47 | # The deeplink url scheme for react native campaigns: |
47 | # Example visit.greece.gr | 48 | # Example visit.greece.gr | ... | ... |
app/src/main/ic_launcher-playstore.png
0 → 100644
40.5 KB
1 | package warp.ly.android_sdk.activities; | 1 | package warp.ly.android_sdk.activities; |
2 | 2 | ||
3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
4 | + | ||
4 | import androidx.fragment.app.FragmentActivity; | 5 | import androidx.fragment.app.FragmentActivity; |
6 | + | ||
5 | import android.widget.Toast; | 7 | import android.widget.Toast; |
6 | 8 | ||
7 | -import ly.warp.sdk.io.request.WarplyInboxRequest; | ||
8 | import ly.warp.sdk.utils.managers.WarplySessionManager; | 9 | import ly.warp.sdk.utils.managers.WarplySessionManager; |
9 | 10 | ||
10 | public abstract class BaseActivity extends FragmentActivity { | 11 | public abstract class BaseActivity extends FragmentActivity { |
... | @@ -13,8 +14,6 @@ public abstract class BaseActivity extends FragmentActivity { | ... | @@ -13,8 +14,6 @@ public abstract class BaseActivity extends FragmentActivity { |
13 | // Constants | 14 | // Constants |
14 | // =========================================================== | 15 | // =========================================================== |
15 | 16 | ||
16 | - protected final WarplyInboxRequest mInboxRequest = new WarplyInboxRequest().setUseCache(true); | ||
17 | - | ||
18 | // =========================================================== | 17 | // =========================================================== |
19 | // Fields | 18 | // Fields |
20 | // =========================================================== | 19 | // =========================================================== |
... | @@ -48,7 +47,6 @@ public abstract class BaseActivity extends FragmentActivity { | ... | @@ -48,7 +47,6 @@ public abstract class BaseActivity extends FragmentActivity { |
48 | // =========================================================== | 47 | // =========================================================== |
49 | 48 | ||
50 | protected void showToast(String message) { | 49 | protected void showToast(String message) { |
51 | - | ||
52 | if (mToast != null) { | 50 | if (mToast != null) { |
53 | mToast.cancel(); | 51 | mToast.cancel(); |
54 | } | 52 | } | ... | ... |
1 | package warp.ly.android_sdk.activities; | 1 | package warp.ly.android_sdk.activities; |
2 | 2 | ||
3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
4 | +import android.view.MenuItem; | ||
4 | 5 | ||
5 | -import androidx.fragment.app.FragmentTabHost; | 6 | +import androidx.annotation.NonNull; |
7 | +import androidx.fragment.app.Fragment; | ||
6 | 8 | ||
9 | +import com.google.android.material.bottomnavigation.BottomNavigationView; | ||
10 | +import com.google.android.material.navigation.NavigationBarView; | ||
11 | + | ||
12 | +import ly.warp.sdk.fragments.LoyaltyFragment; | ||
7 | import warp.ly.android_sdk.R; | 13 | import warp.ly.android_sdk.R; |
8 | -import warp.ly.android_sdk.fragments.InfoFragment; | ||
9 | 14 | ||
10 | -public class MainActivity extends BaseActivity { | 15 | +public class MainActivity extends BaseActivity implements NavigationBarView.OnItemSelectedListener { |
11 | 16 | ||
12 | // =========================================================== | 17 | // =========================================================== |
13 | // Constants | 18 | // Constants |
... | @@ -17,6 +22,9 @@ public class MainActivity extends BaseActivity { | ... | @@ -17,6 +22,9 @@ public class MainActivity extends BaseActivity { |
17 | // Fields | 22 | // Fields |
18 | // =========================================================== | 23 | // =========================================================== |
19 | 24 | ||
25 | + private BottomNavigationView mBottomNavigationView; | ||
26 | + Fragment mFragmentToSet = null; | ||
27 | + | ||
20 | // =========================================================== | 28 | // =========================================================== |
21 | // Methods for/from SuperClass/Interfaces | 29 | // Methods for/from SuperClass/Interfaces |
22 | // =========================================================== | 30 | // =========================================================== |
... | @@ -25,6 +33,8 @@ public class MainActivity extends BaseActivity { | ... | @@ -25,6 +33,8 @@ public class MainActivity extends BaseActivity { |
25 | public void onCreate(Bundle savedInstanceState) { | 33 | public void onCreate(Bundle savedInstanceState) { |
26 | super.onCreate(savedInstanceState); | 34 | super.onCreate(savedInstanceState); |
27 | setContentView(R.layout.activity_main); | 35 | setContentView(R.layout.activity_main); |
36 | + | ||
37 | + mBottomNavigationView = findViewById(R.id.bt_tabs); | ||
28 | initViews(); | 38 | initViews(); |
29 | } | 39 | } |
30 | 40 | ||
... | @@ -33,19 +43,26 @@ public class MainActivity extends BaseActivity { | ... | @@ -33,19 +43,26 @@ public class MainActivity extends BaseActivity { |
33 | super.onResume(); | 43 | super.onResume(); |
34 | } | 44 | } |
35 | 45 | ||
36 | - protected void initViews() { | 46 | + @Override |
37 | - FragmentTabHost tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost); | 47 | + public boolean onNavigationItemSelected(@NonNull MenuItem item) { |
38 | - tabHost.setup(this, getSupportFragmentManager(), android.R.id.tabcontent); | 48 | + switch (item.getItemId()) { |
39 | - tabHost.addTab( | 49 | + case R.id.menu_loyalty: |
40 | - tabHost.newTabSpec("info").setIndicator("info", null), | 50 | + mFragmentToSet = LoyaltyFragment.newInstance(); |
41 | - InfoFragment.class, null); | 51 | + getSupportFragmentManager().beginTransaction().replace(R.id.fl_fragment, mFragmentToSet).commit(); |
42 | - | 52 | + return true; |
53 | + } | ||
54 | + return false; | ||
43 | } | 55 | } |
44 | 56 | ||
45 | // =========================================================== | 57 | // =========================================================== |
46 | // Methods | 58 | // Methods |
47 | // =========================================================== | 59 | // =========================================================== |
48 | 60 | ||
61 | + private void initViews() { | ||
62 | + mBottomNavigationView.setOnItemSelectedListener(this); | ||
63 | + mBottomNavigationView.setSelectedItemId(R.id.menu_home); | ||
64 | + } | ||
65 | + | ||
49 | // =========================================================== | 66 | // =========================================================== |
50 | // Inner and Anonymous Classes | 67 | // Inner and Anonymous Classes |
51 | // =========================================================== | 68 | // =========================================================== | ... | ... |
... | @@ -12,8 +12,6 @@ import ly.warp.sdk.io.callbacks.WarplyReadyCallback; | ... | @@ -12,8 +12,6 @@ import ly.warp.sdk.io.callbacks.WarplyReadyCallback; |
12 | import ly.warp.sdk.utils.WarplyInitializer; | 12 | import ly.warp.sdk.utils.WarplyInitializer; |
13 | import warp.ly.android_sdk.R; | 13 | import warp.ly.android_sdk.R; |
14 | 14 | ||
15 | -import static warp.ly.android_sdk.utils.Constants.SENDER_ID; | ||
16 | - | ||
17 | public class SplashActivity extends BaseActivity { | 15 | public class SplashActivity extends BaseActivity { |
18 | 16 | ||
19 | private WarplyInitializer mWarplyInitializer; | 17 | private WarplyInitializer mWarplyInitializer; |
... | @@ -26,19 +24,17 @@ public class SplashActivity extends BaseActivity { | ... | @@ -26,19 +24,17 @@ public class SplashActivity extends BaseActivity { |
26 | mWarplyInitializer = Warply.getInitializer(this, new WarplyReadyCallback() { | 24 | mWarplyInitializer = Warply.getInitializer(this, new WarplyReadyCallback() { |
27 | @Override | 25 | @Override |
28 | public void onWarplyReady() { | 26 | public void onWarplyReady() { |
29 | - checkForAppUpdate(); | 27 | + startNextActivity(); |
30 | } | 28 | } |
31 | 29 | ||
32 | @Override | 30 | @Override |
33 | public void onWarplyInitTimeOut() { | 31 | public void onWarplyInitTimeOut() { |
34 | - showToast("Warply initialization timeout!"); | 32 | + showToast("Warply timeout!"); |
35 | - checkForAppUpdate(); | ||
36 | } | 33 | } |
37 | 34 | ||
38 | @Override | 35 | @Override |
39 | public void onWarplyPermissionsDenied() { | 36 | public void onWarplyPermissionsDenied() { |
40 | showToast("Warply permissions denied!"); | 37 | showToast("Warply permissions denied!"); |
41 | - checkForAppUpdate(); | ||
42 | } | 38 | } |
43 | }); | 39 | }); |
44 | } | 40 | } |
... | @@ -49,14 +45,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -49,14 +45,7 @@ public class SplashActivity extends BaseActivity { |
49 | mWarplyInitializer.initWithPermissions(this); | 45 | mWarplyInitializer.initWithPermissions(this); |
50 | } | 46 | } |
51 | 47 | ||
52 | -// @Override | ||
53 | -// public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | ||
54 | -// mWarplyInitializer.onRequestPermissionsResult(requestCode, permissions, grantResults); | ||
55 | -// super.onRequestPermissionsResult(requestCode, permissions, grantResults); | ||
56 | -// } | ||
57 | - | ||
58 | private void checkForAppUpdate() { | 48 | private void checkForAppUpdate() { |
59 | - | ||
60 | Warply.checkForAppUpdate(SplashActivity.this, new SimpleCallbackReceiver<Boolean>() { | 49 | Warply.checkForAppUpdate(SplashActivity.this, new SimpleCallbackReceiver<Boolean>() { |
61 | @Override | 50 | @Override |
62 | public void onResult(Boolean updateAccepted, int errorCode) { | 51 | public void onResult(Boolean updateAccepted, int errorCode) { |
... | @@ -68,20 +57,16 @@ public class SplashActivity extends BaseActivity { | ... | @@ -68,20 +57,16 @@ public class SplashActivity extends BaseActivity { |
68 | } | 57 | } |
69 | 58 | ||
70 | private void startNextActivity() { | 59 | private void startNextActivity() { |
71 | - | ||
72 | if (!isFinishing()) { | 60 | if (!isFinishing()) { |
73 | long MIN_SPLASH_TIME = 2000; | 61 | long MIN_SPLASH_TIME = 2000; |
74 | new Timer().schedule(new TimerTask() { | 62 | new Timer().schedule(new TimerTask() { |
75 | 63 | ||
76 | @Override | 64 | @Override |
77 | public void run() { | 65 | public void run() { |
78 | - | ||
79 | runOnUiThread(new Runnable() { | 66 | runOnUiThread(new Runnable() { |
80 | public void run() { | 67 | public void run() { |
81 | if (!isFinishing()) { | 68 | if (!isFinishing()) { |
82 | - Warply.registerGCM(SENDER_ID); | 69 | + startActivity(new Intent(SplashActivity.this, MainActivity.class)); |
83 | - startActivity(new Intent(SplashActivity.this, | ||
84 | - MainActivity.class)); | ||
85 | finish(); | 70 | finish(); |
86 | } | 71 | } |
87 | } | 72 | } | ... | ... |
9.18 KB
5.11 KB
14 KB
18.9 KB
1 | -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | 1 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | - android:layout_width="match_parent" | 2 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | - android:layout_height="match_parent" | ||
4 | - android:background="#363F45"> | ||
5 | - <androidx.fragment.app.FragmentTabHost | ||
6 | - android:id="@android:id/tabhost" | ||
7 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
8 | android:layout_height="match_parent"> | 4 | android:layout_height="match_parent"> |
9 | 5 | ||
10 | - <LinearLayout | ||
11 | - android:layout_width="match_parent" | ||
12 | - android:layout_height="match_parent" | ||
13 | - android:gravity="center" | ||
14 | - android:orientation="vertical"> | ||
15 | - | ||
16 | - <HorizontalScrollView | ||
17 | - android:id="@+id/horizontalScrollView" | ||
18 | - android:layout_width="wrap_content" | ||
19 | - android:layout_height="wrap_content" | ||
20 | - android:layout_gravity="bottom" | ||
21 | - android:background="@android:color/white" | ||
22 | - android:scrollbars="none"> | ||
23 | - | ||
24 | - <TabWidget | ||
25 | - android:id="@android:id/tabs" | ||
26 | - android:layout_width="wrap_content" | ||
27 | - android:layout_height="wrap_content" | ||
28 | - android:layout_gravity="bottom" | ||
29 | - android:background="@android:color/white" /> | ||
30 | - </HorizontalScrollView> | ||
31 | - | ||
32 | <FrameLayout | 6 | <FrameLayout |
33 | - android:id="@android:id/tabcontent" | 7 | + android:id="@+id/fl_fragment" |
34 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
35 | android:layout_height="0dp" | 9 | android:layout_height="0dp" |
36 | - android:layout_weight="1" /> | 10 | + app:layout_constraintBottom_toTopOf="@+id/bt_tabs" |
37 | - </LinearLayout> | 11 | + app:layout_constraintEnd_toEndOf="parent" |
12 | + app:layout_constraintStart_toStartOf="parent" | ||
13 | + app:layout_constraintTop_toTopOf="parent" /> | ||
38 | 14 | ||
39 | - </androidx.fragment.app.FragmentTabHost> | 15 | + <com.google.android.material.bottomnavigation.BottomNavigationView |
16 | + android:id="@+id/bt_tabs" | ||
17 | + android:layout_width="match_parent" | ||
18 | + android:layout_height="64dp" | ||
19 | + style="@style/BottomNavigationView" | ||
20 | + android:background="@android:color/white" | ||
21 | + app:itemTextColor="@drawable/selector_tab_title_color" | ||
22 | + app:itemRippleColor="@color/cos_cyan" | ||
23 | + app:labelVisibilityMode="labeled" | ||
24 | + app:layout_constraintBottom_toBottomOf="parent" | ||
25 | + app:layout_constraintEnd_toEndOf="parent" | ||
26 | + app:layout_constraintStart_toStartOf="parent" | ||
27 | + app:menu="@menu/menu_bottom_nav" /> | ||
40 | 28 | ||
41 | -</RelativeLayout> | 29 | +</androidx.constraintlayout.widget.ConstraintLayout> | ... | ... |
... | @@ -2,22 +2,14 @@ | ... | @@ -2,22 +2,14 @@ |
2 | xmlns:tools="http://schemas.android.com/tools" | 2 | xmlns:tools="http://schemas.android.com/tools" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | - tools:context=".SplashActivity" | 5 | + android:background="@android:color/white" |
6 | - android:background="#363F45"> | 6 | + android:gravity="center"> |
7 | - | ||
8 | - <ProgressBar | ||
9 | - android:id="@+id/progressBar" | ||
10 | - style="?android:attr/progressBarStyleLarge" | ||
11 | - android:layout_width="wrap_content" | ||
12 | - android:layout_height="wrap_content" | ||
13 | - android:layout_centerVertical="true" | ||
14 | - android:layout_centerHorizontal="true" /> | ||
15 | 7 | ||
16 | <ImageView | 8 | <ImageView |
17 | - android:layout_width="wrap_content" | 9 | + android:id="@+id/iv_splash" |
10 | + android:layout_width="match_parent" | ||
18 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
19 | - android:id="@+id/imageView" | ||
20 | - android:layout_above="@+id/progressBar" | ||
21 | android:layout_centerHorizontal="true" | 12 | android:layout_centerHorizontal="true" |
22 | - android:src="@drawable/warply_logo_white" /> | 13 | + android:scaleType="centerCrop" |
14 | + android:src="@drawable/ic_cosmote_logo_horizontal_white" /> | ||
23 | </RelativeLayout> | 15 | </RelativeLayout> | ... | ... |
... | @@ -19,7 +19,7 @@ | ... | @@ -19,7 +19,7 @@ |
19 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
20 | android:layout_weight="1" | 20 | android:layout_weight="1" |
21 | android:scaleType="center" | 21 | android:scaleType="center" |
22 | - android:src="@drawable/ic_launcher" /> | 22 | + android:src="@mipmap/ic_launcher" /> |
23 | 23 | ||
24 | <TextView | 24 | <TextView |
25 | android:id="@+id/tv_campaign_title" | 25 | android:id="@+id/tv_campaign_title" | ... | ... |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@color/ic_launcher_background"/> | ||
4 | + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <background android:drawable="@color/ic_launcher_background"/> | ||
4 | + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
5 | +</adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/src/main/res/mipmap-hdpi/ic_launcher.png
0 → 100644
1.73 KB
3.47 KB
3.68 KB
app/src/main/res/mipmap-mdpi/ic_launcher.png
0 → 100644
1.1 KB
1.99 KB
2.19 KB
2.57 KB
5.42 KB
5.62 KB
4.53 KB
9.86 KB
9.57 KB
6.88 KB
16.3 KB
14.5 KB
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <resources> | 2 | <resources> |
3 | 3 | ||
4 | - <string name="app_name">Warply Android SDK Maven Plugin</string> | 4 | + <string name="app_name">Cosmote demo</string> |
5 | <string name="hello_world">Hello world!</string> | 5 | <string name="hello_world">Hello world!</string> |
6 | <string name="action_settings">Settings</string> | 6 | <string name="action_settings">Settings</string> |
7 | <string name="title_activity_main">MainActivity</string> | 7 | <string name="title_activity_main">MainActivity</string> | ... | ... |
1 | <resources> | 1 | <resources> |
2 | 2 | ||
3 | <!-- Base application theme. --> | 3 | <!-- Base application theme. --> |
4 | - <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | 4 | + <style name="AppTheme" parent="Theme.AppCompat.Light"> |
5 | <!-- Customize your theme here. --> | 5 | <!-- Customize your theme here. --> |
6 | + <item name="android:windowLightStatusBar">true</item> | ||
7 | + <item name="android:statusBarColor">@android:color/white</item> | ||
6 | </style> | 8 | </style> |
7 | 9 | ||
8 | </resources> | 10 | </resources> | ... | ... |
... | @@ -41,6 +41,9 @@ dependencies { | ... | @@ -41,6 +41,9 @@ dependencies { |
41 | api 'org.altbeacon:android-beacon-library:2.19.3' | 41 | api 'org.altbeacon:android-beacon-library:2.19.3' |
42 | api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' | 42 | api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' |
43 | api "commons-logging:commons-logging:1.2" | 43 | api "commons-logging:commons-logging:1.2" |
44 | + api 'de.hdodenhof:circleimageview:3.1.0' | ||
45 | + api group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.2.21' | ||
46 | + api 'com.google.android.material:material:1.5.0' | ||
44 | 47 | ||
45 | //------------------------------ Firebase -----------------------------// | 48 | //------------------------------ Firebase -----------------------------// |
46 | api platform('com.google.firebase:firebase-bom:29.0.3') | 49 | api platform('com.google.firebase:firebase-bom:29.0.3') | ... | ... |
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 | +import android.widget.LinearLayout; | ||
8 | + | ||
9 | +import androidx.annotation.Nullable; | ||
10 | +import androidx.fragment.app.Fragment; | ||
11 | +import androidx.recyclerview.widget.LinearLayoutManager; | ||
12 | +import androidx.recyclerview.widget.RecyclerView; | ||
13 | + | ||
14 | +import org.json.JSONException; | ||
15 | + | ||
16 | +import ly.warp.sdk.R; | ||
17 | +import ly.warp.sdk.io.models.Campaign; | ||
18 | +import ly.warp.sdk.io.models.CampaignList; | ||
19 | +import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; | ||
20 | + | ||
21 | +public class LoyaltyFragment extends Fragment implements View.OnClickListener { | ||
22 | + | ||
23 | + // =========================================================== | ||
24 | + // Constants | ||
25 | + // =========================================================== | ||
26 | + | ||
27 | + // =========================================================== | ||
28 | + // Fields | ||
29 | + // =========================================================== | ||
30 | + | ||
31 | + private RecyclerView mRecyclerDeals, mRecyclerGifts, mRecyclerMore; | ||
32 | + private ProfileCampaignAdapter mAdapterDeals, mAdapterGifts, mAdapterMore; | ||
33 | + private LinearLayout mLlMoreDeals, mLlMoreGifts, mLlMore; | ||
34 | + | ||
35 | + // =========================================================== | ||
36 | + // Methods for/from SuperClass/Interfaces | ||
37 | + // =========================================================== | ||
38 | + | ||
39 | + @Override | ||
40 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
41 | + return inflater.inflate(R.layout.fragment_loyalty, container, false); | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
46 | + super.onViewCreated(view, savedInstanceState); | ||
47 | + | ||
48 | + /********* TEST DATA **********/ | ||
49 | + CampaignList clist = new CampaignList(); | ||
50 | + try { | ||
51 | + clist.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}")); | ||
52 | + clist.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}")); | ||
53 | + } catch (JSONException e) { | ||
54 | + e.printStackTrace(); | ||
55 | + } | ||
56 | + /********* TEST DATA **********/ | ||
57 | + | ||
58 | + mLlMoreDeals = view.findViewById(R.id.ll_more); | ||
59 | + mLlMoreDeals.setOnClickListener(this); | ||
60 | + mLlMoreGifts = view.findViewById(R.id.ll_more2); | ||
61 | + mLlMoreGifts.setOnClickListener(this); | ||
62 | + mLlMore = view.findViewById(R.id.ll_more3); | ||
63 | + mLlMore.setOnClickListener(this); | ||
64 | + | ||
65 | + mRecyclerDeals = view.findViewById(R.id.rv_deals); | ||
66 | + mRecyclerDeals.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | ||
67 | + mAdapterDeals = new ProfileCampaignAdapter(getContext(), clist); | ||
68 | + mRecyclerDeals.setAdapter(mAdapterDeals); | ||
69 | + mAdapterDeals.getPositionClicks() | ||
70 | + .doOnNext(campaign -> { | ||
71 | + | ||
72 | + }) | ||
73 | + .doOnError(error -> { | ||
74 | + }) | ||
75 | + .subscribe(); | ||
76 | + | ||
77 | + mRecyclerGifts = view.findViewById(R.id.rv_gifts); | ||
78 | + mRecyclerGifts.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | ||
79 | + mAdapterGifts = new ProfileCampaignAdapter(getContext(), clist); | ||
80 | + mRecyclerGifts.setAdapter(mAdapterGifts); | ||
81 | + mAdapterGifts.getPositionClicks() | ||
82 | + .doOnNext(campaign -> { | ||
83 | + | ||
84 | + }) | ||
85 | + .doOnError(error -> { | ||
86 | + }) | ||
87 | + .subscribe(); | ||
88 | + | ||
89 | + mRecyclerMore = view.findViewById(R.id.rv_more); | ||
90 | + mRecyclerMore.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | ||
91 | + mAdapterMore = new ProfileCampaignAdapter(getContext(), clist); | ||
92 | + mRecyclerMore.setAdapter(mAdapterMore); | ||
93 | + mAdapterMore.getPositionClicks() | ||
94 | + .doOnNext(campaign -> { | ||
95 | + | ||
96 | + }) | ||
97 | + .doOnError(error -> { | ||
98 | + }) | ||
99 | + .subscribe(); | ||
100 | + } | ||
101 | + | ||
102 | + @Override | ||
103 | + public void onClick(View view) { | ||
104 | +// if(view.getId() == R.id.tv_info){ | ||
105 | +// Intent sendIntent = new Intent(); | ||
106 | +// sendIntent.setAction(Intent.ACTION_SEND); | ||
107 | +// sendIntent.putExtra(Intent.EXTRA_TEXT, tvInfo.getText().toString()); | ||
108 | +// sendIntent.setType("text/plain"); | ||
109 | +// startActivity(Intent.createChooser(sendIntent,"Share")); | ||
110 | +// } | ||
111 | + } | ||
112 | + | ||
113 | + // =========================================================== | ||
114 | + // Methods | ||
115 | + // =========================================================== | ||
116 | + | ||
117 | + public static Fragment newInstance() { | ||
118 | + LoyaltyFragment loyaltyFragment = new LoyaltyFragment(); | ||
119 | + return loyaltyFragment; | ||
120 | + } | ||
121 | + | ||
122 | + // =========================================================== | ||
123 | + // Inner and Anonymous Classes | ||
124 | + // =========================================================== | ||
125 | + | ||
126 | +} |
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 io.reactivex.Observable; | ||
17 | +import io.reactivex.subjects.PublishSubject; | ||
18 | +import ly.warp.sdk.R; | ||
19 | +import ly.warp.sdk.io.models.Campaign; | ||
20 | +import ly.warp.sdk.io.models.CampaignList; | ||
21 | + | ||
22 | + | ||
23 | +public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaignAdapter.ProfileCampaignViewHolder> { | ||
24 | + | ||
25 | + private Context mContext; | ||
26 | + private CampaignList mCampaigns; | ||
27 | + private final PublishSubject<Campaign> onClickSubject = PublishSubject.create(); | ||
28 | + | ||
29 | + public ProfileCampaignAdapter(Context mContext, CampaignList campaignList) { | ||
30 | + this.mContext = mContext; | ||
31 | + this.mCampaigns = campaignList; | ||
32 | + } | ||
33 | + | ||
34 | + public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder { | ||
35 | + private ImageView ivCampaignTitle; | ||
36 | + private TextView tvCampaignTitle; | ||
37 | + | ||
38 | + public ProfileCampaignViewHolder(View view) { | ||
39 | + super(view); | ||
40 | + ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); | ||
41 | + tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); | ||
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 | + | ||
54 | + public Campaign getItem(int id) { | ||
55 | + return mCampaigns.get(id); | ||
56 | + } | ||
57 | + | ||
58 | + public void updateData(CampaignList campaignList) { | ||
59 | + mCampaigns.clear(); | ||
60 | + mCampaigns.addAll(campaignList); | ||
61 | + notifyDataSetChanged(); | ||
62 | + } | ||
63 | + | ||
64 | + | ||
65 | + @Override | ||
66 | + public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
67 | + View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler, parent, false); | ||
68 | + return new ProfileCampaignViewHolder(itemView); | ||
69 | + } | ||
70 | + | ||
71 | + @Override | ||
72 | + public void onBindViewHolder(final ProfileCampaignViewHolder holder, int position) { | ||
73 | + Campaign campaignItem = mCampaigns.get(position); | ||
74 | + | ||
75 | + if (campaignItem != null) { | ||
76 | + if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) { | ||
77 | + Glide.with(mContext) | ||
78 | +// .setDefaultRequestOptions( | ||
79 | +// RequestOptions | ||
80 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
81 | +// .error(R.drawable.ic_default_contact_photo)) | ||
82 | + .load(/*campaignItem.getLogoUrl()*/ R.drawable.ic_cosmote_logo_horizontal_grey) | ||
83 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
84 | + .into(holder.ivCampaignTitle); | ||
85 | + } /*else { | ||
86 | + Glide.with(mContext) | ||
87 | + .load(R.drawable.ic_default_contact_photo) | ||
88 | + .into(holder.ivCampaignTitle); | ||
89 | + }*/ | ||
90 | + | ||
91 | + holder.tvCampaignTitle.setText(campaignItem.getTitle()); | ||
92 | + | ||
93 | + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem)); | ||
94 | + } | ||
95 | + } | ||
96 | + | ||
97 | + public Observable<Campaign> getPositionClicks() { | ||
98 | + return onClickSubject.cache(); | ||
99 | + } | ||
100 | + | ||
101 | +} |
4.49 KB
284 KB
18.9 KB
19 KB
32.4 KB
6.67 KB
7.31 KB
26.8 KB
25.2 KB
5.79 KB
8.67 KB
27.6 KB
5.54 KB
5.84 KB
4.33 KB
27.2 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item | ||
4 | + android:state_pressed="false" | ||
5 | + android:drawable="@drawable/shape_cos_campaign_white" /> | ||
6 | + <item | ||
7 | + android:state_pressed="true" | ||
8 | + android:drawable="@drawable/shape_cos_campaign_white_tr" /> | ||
9 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item | ||
4 | + android:state_pressed="false" | ||
5 | + android:drawable="@drawable/shape_cos_white" /> | ||
6 | + <item | ||
7 | + android:state_pressed="true" | ||
8 | + android:drawable="@drawable/shape_cos_white_tr" /> | ||
9 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:drawable="@drawable/ic_explore" android:state_checked="false"/> | ||
4 | + <item android:drawable="@drawable/ic_explore_pressed" android:state_checked="true"/> | ||
5 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:drawable="@drawable/ic_home_pressed" android:state_checked="false"/> | ||
4 | + <item android:drawable="@drawable/ic_home_pressed" android:state_checked="true"/> | ||
5 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:drawable="@drawable/ic_loyalty" android:state_checked="false"/> | ||
4 | + <item android:drawable="@drawable/ic_loyalty" android:state_selected="true"/> | ||
5 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:drawable="@drawable/ic_profile" android:state_checked="false"/> | ||
4 | + <item android:drawable="@drawable/ic_profile" android:state_checked="true"/> | ||
5 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:drawable="@drawable/ic_shop" android:state_checked="false"/> | ||
4 | + <item android:drawable="@drawable/ic_shop" android:state_checked="true"/> | ||
5 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item android:state_checked="true" android:color="@color/cos_cyan" /> | ||
4 | + <item android:color="@color/cos_grey_dark" /> | ||
5 | +</selector> | ||
... | \ 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 | + android:shape="rectangle"> | ||
4 | + <corners android:radius="4dp" /> | ||
5 | + | ||
6 | + <solid android:color="@android:color/white" /> | ||
7 | +</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 | + android:shape="rectangle"> | ||
4 | + <corners android:radius="4dp" /> | ||
5 | + | ||
6 | + <solid android:color="@color/white_tr" /> | ||
7 | +</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 | + android:shape="rectangle"> | ||
4 | + <gradient | ||
5 | + android:startColor="@color/cos_green" | ||
6 | + android:endColor="@color/cos_blue" | ||
7 | + android:type="linear"/> | ||
8 | + <corners | ||
9 | + android:radius="4dp"/> | ||
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 | + android:shape="rectangle"> | ||
4 | + <corners android:topLeftRadius="30dp" /> | ||
5 | + | ||
6 | + <solid android:color="@color/cos_grey" /> | ||
7 | + | ||
8 | +<!-- <stroke--> | ||
9 | +<!-- android:width="1dp"--> | ||
10 | +<!-- android:color="@color/cos_green" />--> | ||
11 | +</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 | + android:shape="rectangle"> | ||
4 | + <corners android:radius="8dp" /> | ||
5 | + | ||
6 | + <solid android:color="@android:color/white" /> | ||
7 | +</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 | + android:shape="rectangle"> | ||
4 | + <corners android:radius="8dp" /> | ||
5 | + | ||
6 | + <solid android:color="@color/white_tr" /> | ||
7 | +</shape> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | + | ||
3 | +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + android:background="@android:color/white"> | ||
8 | + | ||
9 | + <LinearLayout | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="match_parent" | ||
12 | + android:orientation="vertical"> | ||
13 | + | ||
14 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
15 | + android:id="@+id/cl_header" | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="90dp" | ||
18 | + android:paddingHorizontal="16dp"> | ||
19 | + | ||
20 | + <de.hdodenhof.circleimageview.CircleImageView | ||
21 | + android:id="@+id/iv_profile_photo" | ||
22 | + android:layout_width="50dp" | ||
23 | + android:layout_height="50dp" | ||
24 | + android:src="@drawable/profile_photo" | ||
25 | + app:layout_constraintBottom_toBottomOf="parent" | ||
26 | + app:layout_constraintLeft_toLeftOf="parent" | ||
27 | + app:layout_constraintTop_toTopOf="parent" /> | ||
28 | + | ||
29 | + <TextView | ||
30 | + android:id="@+id/tv_name" | ||
31 | + android:layout_width="wrap_content" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:layout_marginStart="8dp" | ||
34 | + android:layout_marginTop="2dp" | ||
35 | + android:text="@string/cos_profile_name" | ||
36 | + android:textColor="@color/grey" | ||
37 | + app:layout_constraintLeft_toRightOf="@+id/iv_profile_photo" | ||
38 | + app:layout_constraintTop_toTopOf="@+id/iv_profile_photo" /> | ||
39 | + | ||
40 | + <LinearLayout | ||
41 | + android:layout_width="wrap_content" | ||
42 | + android:layout_height="wrap_content" | ||
43 | + android:layout_marginStart="8dp" | ||
44 | + android:layout_marginBottom="6dp" | ||
45 | + android:background="@drawable/shape_cos_gradient" | ||
46 | + android:gravity="center" | ||
47 | + android:paddingHorizontal="4dp" | ||
48 | + app:layout_constraintBottom_toBottomOf="@+id/iv_profile_photo" | ||
49 | + app:layout_constraintLeft_toRightOf="@+id/iv_profile_photo"> | ||
50 | + | ||
51 | + <TextView | ||
52 | + android:id="@+id/tv_type" | ||
53 | + android:layout_width="wrap_content" | ||
54 | + android:layout_height="wrap_content" | ||
55 | + android:text="@string/cos_profile_type" | ||
56 | + android:textColor="@android:color/white" /> | ||
57 | + </LinearLayout> | ||
58 | + | ||
59 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
60 | + android:id="@+id/cl_rewards_wallet" | ||
61 | + android:layout_width="wrap_content" | ||
62 | + android:layout_height="wrap_content" | ||
63 | + app:layout_constraintRight_toRightOf="parent" | ||
64 | + app:layout_constraintTop_toTopOf="@+id/tv_name"> | ||
65 | + | ||
66 | + <TextView | ||
67 | + android:id="@+id/tv_rewards" | ||
68 | + android:layout_width="wrap_content" | ||
69 | + android:layout_height="wrap_content" | ||
70 | + android:layout_marginEnd="12dp" | ||
71 | + android:text="@string/cos_profile_reward" | ||
72 | + android:textColor="@color/grey" | ||
73 | + android:textStyle="bold" | ||
74 | + app:layout_constraintRight_toLeftOf="@+id/iv_rewards_wallet" | ||
75 | + app:layout_constraintTop_toTopOf="parent" /> | ||
76 | + | ||
77 | + <ImageView | ||
78 | + android:id="@+id/iv_rewards_wallet" | ||
79 | + android:layout_width="30dp" | ||
80 | + android:layout_height="30dp" | ||
81 | + android:src="@drawable/ic_rewards_wallet" | ||
82 | + app:layout_constraintBottom_toBottomOf="parent" | ||
83 | + app:layout_constraintRight_toRightOf="parent" | ||
84 | + app:layout_constraintTop_toTopOf="parent" /> | ||
85 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
86 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
87 | + | ||
88 | + <LinearLayout | ||
89 | + android:layout_width="match_parent" | ||
90 | + android:layout_height="wrap_content" | ||
91 | + android:background="@drawable/shape_cos_profile" | ||
92 | + android:paddingBottom="24dp" | ||
93 | + android:orientation="vertical"> | ||
94 | + | ||
95 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
96 | + android:layout_width="match_parent" | ||
97 | + android:layout_height="wrap_content" | ||
98 | + android:layout_marginTop="32dp"> | ||
99 | + | ||
100 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
101 | + android:id="@+id/cl_recycler_inner" | ||
102 | + android:layout_width="match_parent" | ||
103 | + android:layout_height="wrap_content" | ||
104 | + android:layout_marginTop="32dp" | ||
105 | + android:background="@color/white_tr" | ||
106 | + android:paddingBottom="4dp" | ||
107 | + app:layout_constraintLeft_toLeftOf="parent" | ||
108 | + app:layout_constraintRight_toRightOf="parent" | ||
109 | + app:layout_constraintTop_toTopOf="parent"> | ||
110 | + | ||
111 | + <androidx.recyclerview.widget.RecyclerView | ||
112 | + android:id="@+id/rv_deals" | ||
113 | + android:layout_width="match_parent" | ||
114 | + android:layout_height="wrap_content" | ||
115 | + android:layout_marginTop="44dp" | ||
116 | + android:layout_marginBottom="8dp" | ||
117 | + android:clipToPadding="false" | ||
118 | + android:orientation="horizontal" | ||
119 | + android:paddingEnd="10dp" | ||
120 | + app:layout_constraintBottom_toTopOf="@+id/ll_more" | ||
121 | + app:layout_constraintLeft_toLeftOf="parent" | ||
122 | + app:layout_constraintRight_toRightOf="parent" | ||
123 | + app:layout_constraintTop_toTopOf="parent" /> | ||
124 | + | ||
125 | + <LinearLayout | ||
126 | + android:id="@+id/ll_more" | ||
127 | + android:layout_width="wrap_content" | ||
128 | + android:layout_height="wrap_content" | ||
129 | + android:layout_marginStart="16dp" | ||
130 | + android:layout_marginTop="4dp" | ||
131 | + android:layout_marginEnd="10dp" | ||
132 | + android:layout_marginBottom="8dp" | ||
133 | + android:background="@drawable/selector_cos_white" | ||
134 | + android:gravity="center" | ||
135 | + android:paddingHorizontal="6dp" | ||
136 | + android:paddingVertical="2dp" | ||
137 | + app:layout_constraintBottom_toBottomOf="parent" | ||
138 | + app:layout_constraintRight_toRightOf="parent" | ||
139 | + app:layout_constraintTop_toBottomOf="@+id/rv_deals"> | ||
140 | + | ||
141 | + <TextView | ||
142 | + android:id="@+id/tv_more" | ||
143 | + android:layout_width="wrap_content" | ||
144 | + android:layout_height="wrap_content" | ||
145 | + android:text="@string/cos_profile_more" | ||
146 | + android:textColor="@color/cos_green" | ||
147 | + android:textSize="13sp" | ||
148 | + android:textStyle="bold" /> | ||
149 | + </LinearLayout> | ||
150 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
151 | + | ||
152 | + <ImageView | ||
153 | + android:id="@+id/iv_deals_logo" | ||
154 | + android:layout_width="70dp" | ||
155 | + android:layout_height="70dp" | ||
156 | + android:scaleType="centerInside" | ||
157 | + android:layout_marginStart="10dp" | ||
158 | + android:src="@drawable/ic_deals_logo" | ||
159 | + app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner" | ||
160 | + app:layout_constraintLeft_toLeftOf="parent" | ||
161 | + app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner" /> | ||
162 | + | ||
163 | + <TextView | ||
164 | + android:id="@+id/tv_deals_title" | ||
165 | + android:layout_width="wrap_content" | ||
166 | + android:layout_height="wrap_content" | ||
167 | + android:layout_marginStart="4dp" | ||
168 | + android:layout_marginBottom="8dp" | ||
169 | + android:text="@string/cos_deals_title" | ||
170 | + android:textColor="@android:color/white" | ||
171 | + android:textSize="16sp" | ||
172 | + android:textStyle="bold" | ||
173 | + app:layout_constraintBottom_toBottomOf="@+id/iv_deals_logo" | ||
174 | + app:layout_constraintLeft_toRightOf="@+id/iv_deals_logo" /> | ||
175 | + | ||
176 | + <ImageView | ||
177 | + android:id="@+id/iv_code_logo" | ||
178 | + android:layout_width="60dp" | ||
179 | + android:layout_height="60dp" | ||
180 | + android:layout_marginEnd="10dp" | ||
181 | + android:scaleType="centerInside" | ||
182 | + android:src="@drawable/ic_get_code" | ||
183 | + app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner" | ||
184 | + app:layout_constraintRight_toRightOf="parent" | ||
185 | + app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner" /> | ||
186 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
187 | + | ||
188 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
189 | + android:layout_width="match_parent" | ||
190 | + android:layout_height="wrap_content" | ||
191 | + android:layout_marginTop="28dp"> | ||
192 | + | ||
193 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
194 | + android:id="@+id/cl_recycler_inner2" | ||
195 | + android:layout_width="match_parent" | ||
196 | + android:layout_height="wrap_content" | ||
197 | + android:layout_marginTop="36dp" | ||
198 | + android:background="@color/white_tr" | ||
199 | + android:paddingBottom="4dp" | ||
200 | + app:layout_constraintLeft_toLeftOf="parent" | ||
201 | + app:layout_constraintRight_toRightOf="parent" | ||
202 | + app:layout_constraintTop_toTopOf="parent"> | ||
203 | + | ||
204 | + <androidx.recyclerview.widget.RecyclerView | ||
205 | + android:id="@+id/rv_gifts" | ||
206 | + android:layout_width="match_parent" | ||
207 | + android:layout_height="wrap_content" | ||
208 | + android:layout_marginTop="44dp" | ||
209 | + android:layout_marginBottom="8dp" | ||
210 | + android:clipToPadding="false" | ||
211 | + android:orientation="horizontal" | ||
212 | + android:paddingEnd="10dp" | ||
213 | + app:layout_constraintBottom_toTopOf="@+id/ll_more2" | ||
214 | + app:layout_constraintLeft_toLeftOf="parent" | ||
215 | + app:layout_constraintRight_toRightOf="parent" | ||
216 | + app:layout_constraintTop_toTopOf="parent" /> | ||
217 | + | ||
218 | + <LinearLayout | ||
219 | + android:id="@+id/ll_more2" | ||
220 | + android:layout_width="wrap_content" | ||
221 | + android:layout_height="wrap_content" | ||
222 | + android:layout_marginStart="16dp" | ||
223 | + android:layout_marginTop="4dp" | ||
224 | + android:layout_marginEnd="10dp" | ||
225 | + android:layout_marginBottom="8dp" | ||
226 | + android:background="@drawable/selector_cos_white" | ||
227 | + android:gravity="center" | ||
228 | + android:paddingHorizontal="6dp" | ||
229 | + android:paddingVertical="2dp" | ||
230 | + app:layout_constraintBottom_toBottomOf="parent" | ||
231 | + app:layout_constraintRight_toRightOf="parent" | ||
232 | + app:layout_constraintTop_toBottomOf="@+id/rv_gifts"> | ||
233 | + | ||
234 | + <TextView | ||
235 | + android:id="@+id/tv_more2" | ||
236 | + android:layout_width="wrap_content" | ||
237 | + android:layout_height="wrap_content" | ||
238 | + android:text="@string/cos_profile_more" | ||
239 | + android:textColor="@color/cos_green" | ||
240 | + android:textSize="13sp" | ||
241 | + android:textStyle="bold" /> | ||
242 | + </LinearLayout> | ||
243 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
244 | + | ||
245 | + <ImageView | ||
246 | + android:id="@+id/iv_gifts_logo" | ||
247 | + android:layout_width="70dp" | ||
248 | + android:layout_height="70dp" | ||
249 | + android:layout_marginStart="10dp" | ||
250 | + android:scaleType="centerInside" | ||
251 | + android:src="@drawable/ic_gifts_logo" | ||
252 | + app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner2" | ||
253 | + app:layout_constraintLeft_toLeftOf="parent" | ||
254 | + app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner2" /> | ||
255 | + | ||
256 | + <TextView | ||
257 | + android:id="@+id/tv_gifts_title" | ||
258 | + android:layout_width="wrap_content" | ||
259 | + android:layout_height="wrap_content" | ||
260 | + android:layout_marginStart="4dp" | ||
261 | + android:layout_marginBottom="8dp" | ||
262 | + android:text="@string/cos_gifts_title" | ||
263 | + android:textColor="@android:color/white" | ||
264 | + android:textSize="16sp" | ||
265 | + android:textStyle="bold" | ||
266 | + app:layout_constraintBottom_toBottomOf="@+id/iv_gifts_logo" | ||
267 | + app:layout_constraintLeft_toRightOf="@+id/iv_gifts_logo" /> | ||
268 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
269 | + | ||
270 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
271 | + android:layout_width="match_parent" | ||
272 | + android:layout_height="wrap_content" | ||
273 | + android:layout_marginTop="28dp"> | ||
274 | + | ||
275 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
276 | + android:id="@+id/cl_recycler_inner3" | ||
277 | + android:layout_width="match_parent" | ||
278 | + android:layout_height="wrap_content" | ||
279 | + android:layout_marginTop="36dp" | ||
280 | + android:background="@color/white_tr" | ||
281 | + android:paddingBottom="4dp" | ||
282 | + app:layout_constraintLeft_toLeftOf="parent" | ||
283 | + app:layout_constraintRight_toRightOf="parent" | ||
284 | + app:layout_constraintTop_toTopOf="parent"> | ||
285 | + | ||
286 | + <androidx.recyclerview.widget.RecyclerView | ||
287 | + android:id="@+id/rv_more" | ||
288 | + android:layout_width="match_parent" | ||
289 | + android:layout_height="wrap_content" | ||
290 | + android:layout_marginTop="44dp" | ||
291 | + android:layout_marginBottom="8dp" | ||
292 | + android:clipToPadding="false" | ||
293 | + android:orientation="horizontal" | ||
294 | + android:paddingEnd="10dp" | ||
295 | + app:layout_constraintBottom_toTopOf="@+id/ll_more3" | ||
296 | + app:layout_constraintLeft_toLeftOf="parent" | ||
297 | + app:layout_constraintRight_toRightOf="parent" | ||
298 | + app:layout_constraintTop_toTopOf="parent" /> | ||
299 | + | ||
300 | + <LinearLayout | ||
301 | + android:id="@+id/ll_more3" | ||
302 | + android:layout_width="wrap_content" | ||
303 | + android:layout_height="wrap_content" | ||
304 | + android:layout_marginStart="16dp" | ||
305 | + android:layout_marginTop="4dp" | ||
306 | + android:layout_marginEnd="10dp" | ||
307 | + android:layout_marginBottom="8dp" | ||
308 | + android:background="@drawable/selector_cos_white" | ||
309 | + android:gravity="center" | ||
310 | + android:paddingHorizontal="6dp" | ||
311 | + android:paddingVertical="2dp" | ||
312 | + app:layout_constraintBottom_toBottomOf="parent" | ||
313 | + app:layout_constraintRight_toRightOf="parent" | ||
314 | + app:layout_constraintTop_toBottomOf="@+id/rv_more"> | ||
315 | + | ||
316 | + <TextView | ||
317 | + android:id="@+id/tv_more3" | ||
318 | + android:layout_width="wrap_content" | ||
319 | + android:layout_height="wrap_content" | ||
320 | + android:text="@string/cos_profile_more" | ||
321 | + android:textColor="@color/cos_green" | ||
322 | + android:textSize="13sp" | ||
323 | + android:textStyle="bold" /> | ||
324 | + </LinearLayout> | ||
325 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
326 | + | ||
327 | + <ImageView | ||
328 | + android:id="@+id/iv_more_logo" | ||
329 | + android:layout_width="70dp" | ||
330 | + android:layout_height="70dp" | ||
331 | + android:layout_marginStart="10dp" | ||
332 | + android:scaleType="centerInside" | ||
333 | + android:src="@drawable/ic_more_logo" | ||
334 | + app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner3" | ||
335 | + app:layout_constraintLeft_toLeftOf="parent" | ||
336 | + app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner3" /> | ||
337 | + | ||
338 | + <TextView | ||
339 | + android:id="@+id/tv_more_title" | ||
340 | + android:layout_width="wrap_content" | ||
341 | + android:layout_height="wrap_content" | ||
342 | + android:layout_marginStart="4dp" | ||
343 | + android:layout_marginBottom="8dp" | ||
344 | + android:text="@string/cos_more_title" | ||
345 | + android:textColor="@android:color/white" | ||
346 | + android:textSize="16sp" | ||
347 | + android:textStyle="bold" | ||
348 | + app:layout_constraintBottom_toBottomOf="@+id/iv_more_logo" | ||
349 | + app:layout_constraintLeft_toRightOf="@+id/iv_more_logo" /> | ||
350 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
351 | + </LinearLayout> | ||
352 | + </LinearLayout> | ||
353 | +</ScrollView> |
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="360dp" | ||
6 | + android:layout_height="150dp" | ||
7 | + android:layout_marginStart="10dp" | ||
8 | + android:background="@drawable/selector_cos_campaign"> | ||
9 | + | ||
10 | + <androidx.constraintlayout.widget.Guideline | ||
11 | + android:id="@+id/gl_vertical_60_percent" | ||
12 | + android:layout_width="wrap_content" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + android:orientation="vertical" | ||
15 | + app:layout_constraintGuide_percent="0.6" /> | ||
16 | + | ||
17 | + <ImageView | ||
18 | + android:id="@+id/iv_campaign_logo" | ||
19 | + android:layout_width="0dp" | ||
20 | + android:layout_height="0dp" | ||
21 | + android:scaleType="centerCrop" | ||
22 | + app:layout_constraintBottom_toBottomOf="parent" | ||
23 | + app:layout_constraintHorizontal_bias="0.0" | ||
24 | + app:layout_constraintLeft_toLeftOf="parent" | ||
25 | + tools:src="@drawable/ic_cosmote_logo_horizontal_grey" | ||
26 | + app:layout_constraintRight_toLeftOf="@+id/gl_vertical_60_percent" | ||
27 | + app:layout_constraintTop_toTopOf="parent" | ||
28 | + app:layout_constraintVertical_bias="0.0" /> | ||
29 | + | ||
30 | + <TextView | ||
31 | + android:id="@+id/tv_campaign_title" | ||
32 | + android:layout_width="0dp" | ||
33 | + android:layout_height="wrap_content" | ||
34 | + android:layout_marginHorizontal="12dp" | ||
35 | + android:gravity="center" | ||
36 | + android:maxLines="4" | ||
37 | + android:textColor="@color/grey" | ||
38 | + app:layout_constraintBottom_toBottomOf="parent" | ||
39 | + app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent" | ||
40 | + app:layout_constraintRight_toRightOf="parent" | ||
41 | + app:layout_constraintTop_toTopOf="parent" | ||
42 | + tools:text="-10% in all products from IKEA" /> | ||
43 | + | ||
44 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <item | ||
4 | + android:id="@+id/menu_home" | ||
5 | + android:icon="@drawable/selector_menu_home" | ||
6 | + android:title="@string/menu_home" /> | ||
7 | + <item | ||
8 | + android:id="@+id/menu_explore" | ||
9 | + android:icon="@drawable/selector_menu_explore" | ||
10 | + android:title="@string/menu_explore" /> | ||
11 | + <item | ||
12 | + android:id="@+id/menu_shop" | ||
13 | + android:icon="@drawable/selector_menu_shop" | ||
14 | + android:title="@string/menu_shop" /> | ||
15 | + <item | ||
16 | + android:id="@+id/menu_loyalty" | ||
17 | + android:icon="@drawable/selector_menu_loyalty" | ||
18 | + android:title="@string/menu_loyalty" /> | ||
19 | + <item | ||
20 | + android:id="@+id/menu_profile" | ||
21 | + android:icon="@drawable/selector_menu_profile" | ||
22 | + android:title="@string/menu_profile" /> | ||
23 | +</menu> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -3,4 +3,11 @@ | ... | @@ -3,4 +3,11 @@ |
3 | <color name="colorPrimary">#0a1a50</color> | 3 | <color name="colorPrimary">#0a1a50</color> |
4 | <color name="colorAccent">#044C86</color> | 4 | <color name="colorAccent">#044C86</color> |
5 | <color name="colorPrimaryDark">#0a1a50</color> | 5 | <color name="colorPrimaryDark">#0a1a50</color> |
6 | + <color name="grey">#415564</color> | ||
7 | + <color name="cos_green">#65DD6B</color> | ||
8 | + <color name="cos_blue">#0377C1</color> | ||
9 | + <color name="cos_grey">#3D5265</color> | ||
10 | + <color name="white_tr">#32FFFFFF</color> | ||
11 | + <color name="cos_grey_dark">#787878</color> | ||
12 | + <color name="cos_cyan">#A3F2DA</color> | ||
6 | </resources> | 13 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,4 +4,20 @@ | ... | @@ -4,4 +4,20 @@ |
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 | + | ||
8 | + <string name="cos_profile_tab">Profile</string> | ||
9 | + <string name="welcome_user">Γεία σου Γιώργος !</string> | ||
10 | + <string name="cos_profile_name">Γιώργος</string> | ||
11 | + <string name="cos_profile_type">Traveller</string> | ||
12 | + <string name="header_add">Προσθήκη</string> | ||
13 | + <string name="cos_profile_reward">My reward wallet</string> | ||
14 | + <string name="cos_deals_title">Deals for You</string> | ||
15 | + <string name="cos_profile_more">Δες περισσότερα</string> | ||
16 | + <string name="cos_gifts_title">Gifts for You</string> | ||
17 | + <string name="cos_more_title">More for You</string> | ||
18 | + <string name="menu_home">Αρχική</string> | ||
19 | + <string name="menu_explore">Ανακάλυψε</string> | ||
20 | + <string name="menu_shop">Shop</string> | ||
21 | + <string name="menu_loyalty">Loyalty</string> | ||
22 | + <string name="menu_profile">Προφίλ</string> | ||
7 | </resources> | 23 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -24,4 +24,8 @@ | ... | @@ -24,4 +24,8 @@ |
24 | <item name="android:textStyle">bold</item> | 24 | <item name="android:textStyle">bold</item> |
25 | </style> | 25 | </style> |
26 | 26 | ||
27 | + <style name="BottomNavigationView" parent="Widget.Design.BottomNavigationView"> | ||
28 | + <item name="android:textSize">14sp</item> | ||
29 | + </style> | ||
30 | + | ||
27 | </resources> | 31 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment