Panagiotis Triantafyllou

cosmote branch for demo app

Showing 73 changed files with 862 additions and 101 deletions
......@@ -18,7 +18,8 @@
android:extractNativeLibs="true"
android:fullBackupContent="false"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_notification_logo"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:installLocation="internalOnly"
android:label="@string/app_name"
android:largeHeap="true"
......
# {@link ly.warp.sdk.utils.WarplyProperty}
# The app uuid the warply sdk need to connect to the engage server
Uuid=
# cosmote demo app f83dfde1145e4c2da69793abb2f579af
Uuid=f83dfde1145e4c2da69793abb2f579af
# If we need to see logs in Logcat
Debug=false
Debug=true
# Production or Development environment of the engage server
# Production: https://engage.warp.ly
......@@ -41,7 +42,7 @@ MerchantId=20113
# The login type must be one of the below:
# email, msisdn, username
LoginType=email
LoginType=msisdn
# The deeplink url scheme for react native campaigns:
# Example visit.greece.gr
......
package warp.ly.android_sdk.activities;
import android.os.Bundle;
import androidx.fragment.app.FragmentActivity;
import android.widget.Toast;
import ly.warp.sdk.io.request.WarplyInboxRequest;
import ly.warp.sdk.utils.managers.WarplySessionManager;
public abstract class BaseActivity extends FragmentActivity {
......@@ -13,8 +14,6 @@ public abstract class BaseActivity extends FragmentActivity {
// Constants
// ===========================================================
protected final WarplyInboxRequest mInboxRequest = new WarplyInboxRequest().setUseCache(true);
// ===========================================================
// Fields
// ===========================================================
......@@ -48,7 +47,6 @@ public abstract class BaseActivity extends FragmentActivity {
// ===========================================================
protected void showToast(String message) {
if (mToast != null) {
mToast.cancel();
}
......
package warp.ly.android_sdk.activities;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.fragment.app.FragmentTabHost;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
import ly.warp.sdk.fragments.LoyaltyFragment;
import warp.ly.android_sdk.R;
import warp.ly.android_sdk.fragments.InfoFragment;
public class MainActivity extends BaseActivity {
public class MainActivity extends BaseActivity implements NavigationBarView.OnItemSelectedListener {
// ===========================================================
// Constants
......@@ -17,6 +22,9 @@ public class MainActivity extends BaseActivity {
// Fields
// ===========================================================
private BottomNavigationView mBottomNavigationView;
Fragment mFragmentToSet = null;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
......@@ -25,6 +33,8 @@ public class MainActivity extends BaseActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mBottomNavigationView = findViewById(R.id.bt_tabs);
initViews();
}
......@@ -33,19 +43,26 @@ public class MainActivity extends BaseActivity {
super.onResume();
}
protected void initViews() {
FragmentTabHost tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
tabHost.setup(this, getSupportFragmentManager(), android.R.id.tabcontent);
tabHost.addTab(
tabHost.newTabSpec("info").setIndicator("info", null),
InfoFragment.class, null);
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_loyalty:
mFragmentToSet = LoyaltyFragment.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.fl_fragment, mFragmentToSet).commit();
return true;
}
return false;
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mBottomNavigationView.setOnItemSelectedListener(this);
mBottomNavigationView.setSelectedItemId(R.id.menu_home);
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
......
......@@ -12,8 +12,6 @@ import ly.warp.sdk.io.callbacks.WarplyReadyCallback;
import ly.warp.sdk.utils.WarplyInitializer;
import warp.ly.android_sdk.R;
import static warp.ly.android_sdk.utils.Constants.SENDER_ID;
public class SplashActivity extends BaseActivity {
private WarplyInitializer mWarplyInitializer;
......@@ -26,19 +24,17 @@ public class SplashActivity extends BaseActivity {
mWarplyInitializer = Warply.getInitializer(this, new WarplyReadyCallback() {
@Override
public void onWarplyReady() {
checkForAppUpdate();
startNextActivity();
}
@Override
public void onWarplyInitTimeOut() {
showToast("Warply initialization timeout!");
checkForAppUpdate();
showToast("Warply timeout!");
}
@Override
public void onWarplyPermissionsDenied() {
showToast("Warply permissions denied!");
checkForAppUpdate();
}
});
}
......@@ -49,14 +45,7 @@ public class SplashActivity extends BaseActivity {
mWarplyInitializer.initWithPermissions(this);
}
// @Override
// public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
// mWarplyInitializer.onRequestPermissionsResult(requestCode, permissions, grantResults);
// super.onRequestPermissionsResult(requestCode, permissions, grantResults);
// }
private void checkForAppUpdate() {
Warply.checkForAppUpdate(SplashActivity.this, new SimpleCallbackReceiver<Boolean>() {
@Override
public void onResult(Boolean updateAccepted, int errorCode) {
......@@ -68,20 +57,16 @@ public class SplashActivity extends BaseActivity {
}
private void startNextActivity() {
if (!isFinishing()) {
long MIN_SPLASH_TIME = 2000;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
public void run() {
if (!isFinishing()) {
Warply.registerGCM(SENDER_ID);
startActivity(new Intent(SplashActivity.this,
MainActivity.class));
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}
}
......
package warp.ly.android_sdk.utils;
/**
* Created by Panagiotis Triantafyllou on 14-Feb-19.
*/
public class Constants {
public static final String SENDER_ID = "791605800998";
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#363F45">
<androidx.fragment.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@android:color/white"
android:scrollbars="none">
android:layout_height="match_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@android:color/white" />
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<FrameLayout
android:id="@+id/fl_fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bt_tabs"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.fragment.app.FragmentTabHost>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bt_tabs"
android:layout_width="match_parent"
android:layout_height="64dp"
style="@style/BottomNavigationView"
android:background="@android:color/white"
app:itemTextColor="@drawable/selector_tab_title_color"
app:itemRippleColor="@color/cos_cyan"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/menu_bottom_nav" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -2,22 +2,14 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SplashActivity"
android:background="#363F45">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
android:background="@android:color/white"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:id="@+id/iv_splash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_above="@+id/progressBar"
android:layout_centerHorizontal="true"
android:src="@drawable/warply_logo_white" />
android:scaleType="centerCrop"
android:src="@drawable/ic_cosmote_logo_horizontal_white" />
</RelativeLayout>
......
......@@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tv_campaign_title"
......
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Warply Android SDK Maven Plugin</string>
<string name="app_name">Cosmote demo</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
......
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/white</item>
</style>
</resources>
......
......@@ -41,6 +41,9 @@ dependencies {
api 'org.altbeacon:android-beacon-library:2.19.3'
api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
api "commons-logging:commons-logging:1.2"
api 'de.hdodenhof:circleimageview:3.1.0'
api group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.2.21'
api 'com.google.android.material:material:1.5.0'
//------------------------------ Firebase -----------------------------//
api platform('com.google.firebase:firebase-bom:29.0.3')
......
package ly.warp.sdk.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.json.JSONException;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.views.adapters.ProfileCampaignAdapter;
public class LoyaltyFragment extends Fragment implements View.OnClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private RecyclerView mRecyclerDeals, mRecyclerGifts, mRecyclerMore;
private ProfileCampaignAdapter mAdapterDeals, mAdapterGifts, mAdapterMore;
private LinearLayout mLlMoreDeals, mLlMoreGifts, mLlMore;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_loyalty, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
/********* TEST DATA **********/
CampaignList clist = new CampaignList();
try {
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\"}"));
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\"}"));
} catch (JSONException e) {
e.printStackTrace();
}
/********* TEST DATA **********/
mLlMoreDeals = view.findViewById(R.id.ll_more);
mLlMoreDeals.setOnClickListener(this);
mLlMoreGifts = view.findViewById(R.id.ll_more2);
mLlMoreGifts.setOnClickListener(this);
mLlMore = view.findViewById(R.id.ll_more3);
mLlMore.setOnClickListener(this);
mRecyclerDeals = view.findViewById(R.id.rv_deals);
mRecyclerDeals.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterDeals = new ProfileCampaignAdapter(getContext(), clist);
mRecyclerDeals.setAdapter(mAdapterDeals);
mAdapterDeals.getPositionClicks()
.doOnNext(campaign -> {
})
.doOnError(error -> {
})
.subscribe();
mRecyclerGifts = view.findViewById(R.id.rv_gifts);
mRecyclerGifts.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterGifts = new ProfileCampaignAdapter(getContext(), clist);
mRecyclerGifts.setAdapter(mAdapterGifts);
mAdapterGifts.getPositionClicks()
.doOnNext(campaign -> {
})
.doOnError(error -> {
})
.subscribe();
mRecyclerMore = view.findViewById(R.id.rv_more);
mRecyclerMore.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterMore = new ProfileCampaignAdapter(getContext(), clist);
mRecyclerMore.setAdapter(mAdapterMore);
mAdapterMore.getPositionClicks()
.doOnNext(campaign -> {
})
.doOnError(error -> {
})
.subscribe();
}
@Override
public void onClick(View view) {
// if(view.getId() == R.id.tv_info){
// Intent sendIntent = new Intent();
// sendIntent.setAction(Intent.ACTION_SEND);
// sendIntent.putExtra(Intent.EXTRA_TEXT, tvInfo.getText().toString());
// sendIntent.setType("text/plain");
// startActivity(Intent.createChooser(sendIntent,"Share"));
// }
}
// ===========================================================
// Methods
// ===========================================================
public static Fragment newInstance() {
LoyaltyFragment loyaltyFragment = new LoyaltyFragment();
return loyaltyFragment;
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaignAdapter.ProfileCampaignViewHolder> {
private Context mContext;
private CampaignList mCampaigns;
private final PublishSubject<Campaign> onClickSubject = PublishSubject.create();
public ProfileCampaignAdapter(Context mContext, CampaignList campaignList) {
this.mContext = mContext;
this.mCampaigns = campaignList;
}
public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCampaignTitle;
private TextView tvCampaignTitle;
public ProfileCampaignViewHolder(View view) {
super(view);
ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
}
}
@Override
public int getItemCount() {
if (mCampaigns == null)
return 0;
else
return mCampaigns.size();
}
public Campaign getItem(int id) {
return mCampaigns.get(id);
}
public void updateData(CampaignList campaignList) {
mCampaigns.clear();
mCampaigns.addAll(campaignList);
notifyDataSetChanged();
}
@Override
public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler, parent, false);
return new ProfileCampaignViewHolder(itemView);
}
@Override
public void onBindViewHolder(final ProfileCampaignViewHolder holder, int position) {
Campaign campaignItem = mCampaigns.get(position);
if (campaignItem != null) {
if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) {
Glide.with(mContext)
// .setDefaultRequestOptions(
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.load(/*campaignItem.getLogoUrl()*/ R.drawable.ic_cosmote_logo_horizontal_grey)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCampaignTitle);
} /*else {
Glide.with(mContext)
.load(R.drawable.ic_default_contact_photo)
.into(holder.ivCampaignTitle);
}*/
holder.tvCampaignTitle.setText(campaignItem.getTitle());
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem));
}
}
public Observable<Campaign> getPositionClicks() {
return onClickSubject.cache();
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="false"
android:drawable="@drawable/shape_cos_campaign_white" />
<item
android:state_pressed="true"
android:drawable="@drawable/shape_cos_campaign_white_tr" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="false"
android:drawable="@drawable/shape_cos_white" />
<item
android:state_pressed="true"
android:drawable="@drawable/shape_cos_white_tr" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_explore" android:state_checked="false"/>
<item android:drawable="@drawable/ic_explore_pressed" android:state_checked="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_home_pressed" android:state_checked="false"/>
<item android:drawable="@drawable/ic_home_pressed" android:state_checked="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_loyalty" android:state_checked="false"/>
<item android:drawable="@drawable/ic_loyalty" android:state_selected="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_profile" android:state_checked="false"/>
<item android:drawable="@drawable/ic_profile" android:state_checked="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_shop" android:state_checked="false"/>
<item android:drawable="@drawable/ic_shop" android:state_checked="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/cos_cyan" />
<item android:color="@color/cos_grey_dark" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@android:color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@color/white_tr" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@color/cos_green"
android:endColor="@color/cos_blue"
android:type="linear"/>
<corners
android:radius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="30dp" />
<solid android:color="@color/cos_grey" />
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="@color/cos_green" />-->
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@android:color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@color/white_tr" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_header"
android:layout_width="match_parent"
android:layout_height="90dp"
android:paddingHorizontal="16dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/iv_profile_photo"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/profile_photo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:text="@string/cos_profile_name"
android:textColor="@color/grey"
app:layout_constraintLeft_toRightOf="@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf="@+id/iv_profile_photo" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginBottom="6dp"
android:background="@drawable/shape_cos_gradient"
android:gravity="center"
android:paddingHorizontal="4dp"
app:layout_constraintBottom_toBottomOf="@+id/iv_profile_photo"
app:layout_constraintLeft_toRightOf="@+id/iv_profile_photo">
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_profile_type"
android:textColor="@android:color/white" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_rewards_wallet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_name">
<TextView
android:id="@+id/tv_rewards"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:text="@string/cos_profile_reward"
android:textColor="@color/grey"
android:textStyle="bold"
app:layout_constraintRight_toLeftOf="@+id/iv_rewards_wallet"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_rewards_wallet"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_rewards_wallet"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_cos_profile"
android:paddingBottom="24dp"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_recycler_inner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:background="@color/white_tr"
android:paddingBottom="4dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_deals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingEnd="10dp"
app:layout_constraintBottom_toTopOf="@+id/ll_more"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:background="@drawable/selector_cos_white"
android:gravity="center"
android:paddingHorizontal="6dp"
android:paddingVertical="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_deals">
<TextView
android:id="@+id/tv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_profile_more"
android:textColor="@color/cos_green"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_deals_logo"
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="centerInside"
android:layout_marginStart="10dp"
android:src="@drawable/ic_deals_logo"
app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner" />
<TextView
android:id="@+id/tv_deals_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginBottom="8dp"
android:text="@string/cos_deals_title"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/iv_deals_logo"
app:layout_constraintLeft_toRightOf="@+id/iv_deals_logo" />
<ImageView
android:id="@+id/iv_code_logo"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginEnd="10dp"
android:scaleType="centerInside"
android:src="@drawable/ic_get_code"
app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="28dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_recycler_inner2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:background="@color/white_tr"
android:paddingBottom="4dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_gifts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingEnd="10dp"
app:layout_constraintBottom_toTopOf="@+id/ll_more2"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_more2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:background="@drawable/selector_cos_white"
android:gravity="center"
android:paddingHorizontal="6dp"
android:paddingVertical="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_gifts">
<TextView
android:id="@+id/tv_more2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_profile_more"
android:textColor="@color/cos_green"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_gifts_logo"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:scaleType="centerInside"
android:src="@drawable/ic_gifts_logo"
app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner2"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner2" />
<TextView
android:id="@+id/tv_gifts_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginBottom="8dp"
android:text="@string/cos_gifts_title"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/iv_gifts_logo"
app:layout_constraintLeft_toRightOf="@+id/iv_gifts_logo" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="28dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_recycler_inner3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:background="@color/white_tr"
android:paddingBottom="4dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingEnd="10dp"
app:layout_constraintBottom_toTopOf="@+id/ll_more3"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_more3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:background="@drawable/selector_cos_white"
android:gravity="center"
android:paddingHorizontal="6dp"
android:paddingVertical="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_more">
<TextView
android:id="@+id/tv_more3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_profile_more"
android:textColor="@color/cos_green"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_more_logo"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:scaleType="centerInside"
android:src="@drawable/ic_more_logo"
app:layout_constraintBottom_toTopOf="@+id/cl_recycler_inner3"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/cl_recycler_inner3" />
<TextView
android:id="@+id/tv_more_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginBottom="8dp"
android:text="@string/cos_more_title"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/iv_more_logo"
app:layout_constraintLeft_toRightOf="@+id/iv_more_logo" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="360dp"
android:layout_height="150dp"
android:layout_marginStart="10dp"
android:background="@drawable/selector_cos_campaign">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_60_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
<ImageView
android:id="@+id/iv_campaign_logo"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
tools:src="@drawable/ic_cosmote_logo_horizontal_grey"
app:layout_constraintRight_toLeftOf="@+id/gl_vertical_60_percent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/tv_campaign_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="12dp"
android:gravity="center"
android:maxLines="4"
android:textColor="@color/grey"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="-10% in all products from IKEA" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_home"
android:icon="@drawable/selector_menu_home"
android:title="@string/menu_home" />
<item
android:id="@+id/menu_explore"
android:icon="@drawable/selector_menu_explore"
android:title="@string/menu_explore" />
<item
android:id="@+id/menu_shop"
android:icon="@drawable/selector_menu_shop"
android:title="@string/menu_shop" />
<item
android:id="@+id/menu_loyalty"
android:icon="@drawable/selector_menu_loyalty"
android:title="@string/menu_loyalty" />
<item
android:id="@+id/menu_profile"
android:icon="@drawable/selector_menu_profile"
android:title="@string/menu_profile" />
</menu>
\ No newline at end of file
......@@ -3,4 +3,11 @@
<color name="colorPrimary">#0a1a50</color>
<color name="colorAccent">#044C86</color>
<color name="colorPrimaryDark">#0a1a50</color>
<color name="grey">#415564</color>
<color name="cos_green">#65DD6B</color>
<color name="cos_blue">#0377C1</color>
<color name="cos_grey">#3D5265</color>
<color name="white_tr">#32FFFFFF</color>
<color name="cos_grey_dark">#787878</color>
<color name="cos_cyan">#A3F2DA</color>
</resources>
\ No newline at end of file
......
......@@ -4,4 +4,20 @@
<string name="rate_dialog_positive">Rate Now</string>
<string name="rate_diloag_neutral">Remind Me Later</string>
<string name="rate_dialog_negative">No, Thanks</string>
<string name="cos_profile_tab">Profile</string>
<string name="welcome_user">Γεία σου Γιώργος !</string>
<string name="cos_profile_name">Γιώργος</string>
<string name="cos_profile_type">Traveller</string>
<string name="header_add">Προσθήκη</string>
<string name="cos_profile_reward">My reward wallet</string>
<string name="cos_deals_title">Deals for You</string>
<string name="cos_profile_more">Δες περισσότερα</string>
<string name="cos_gifts_title">Gifts for You</string>
<string name="cos_more_title">More for You</string>
<string name="menu_home">Αρχική</string>
<string name="menu_explore">Ανακάλυψε</string>
<string name="menu_shop">Shop</string>
<string name="menu_loyalty">Loyalty</string>
<string name="menu_profile">Προφίλ</string>
</resources>
\ No newline at end of file
......
......@@ -24,4 +24,8 @@
<item name="android:textStyle">bold</item>
</style>
<style name="BottomNavigationView" parent="Widget.Design.BottomNavigationView">
<item name="android:textSize">14sp</item>
</style>
</resources>
\ No newline at end of file
......