Panagiotis Triantafyllou

telematics demo ui

Showing 21 changed files with 521 additions and 333 deletions
......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("7000070282"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
.setGuid("7000000831"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -3,6 +3,7 @@ package ly.warp.sdk.activities;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.hardware.Sensor;
......@@ -63,7 +64,7 @@ public class TelematicsActivity extends Activity implements View.OnClickListener
private ImageView mIvBack;
private boolean mIsTripStarted = false;
private LinearLayout mLlTripButton, mLlTelematicsMain;
private LinearLayout mLlTripButton, mLlTelematicsMain, mLlTelematicsHistory;
private TextView mTvTripButton, mTvSensorData, mTvVelocity, mTvAvgVelocity, mTvRecordsSaved,
mTvOrientationCount, mTvTouchCount;
private SensorManager mSensorManager;
......@@ -123,6 +124,8 @@ public class TelematicsActivity extends Activity implements View.OnClickListener
mEtSampleTime = findViewById(R.id.et_save);
mRlMainScroll = findViewById(R.id.rl_main_scroll);
mRlMainScroll.setOnTouchListener(mScrollTouchListener);
mLlTelematicsHistory = findViewById(R.id.ll_telematics_history);
mLlTelematicsHistory.setOnClickListener(this);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
previousLocation = null;
......@@ -205,6 +208,11 @@ public class TelematicsActivity extends Activity implements View.OnClickListener
onBackPressed();
return;
}
if (view.getId() == R.id.ll_telematics_history) {
Intent intent = new Intent(this, TelematicsHistoryActivity.class);
startActivity(intent);
return;
}
if (view.getId() == R.id.ll_activate_button) {
if (mIsTripStarted) {
mEtLimit.setEnabled(true);
......@@ -503,15 +511,15 @@ public class TelematicsActivity extends Activity implements View.OnClickListener
}
//TODO: uncomment if needed to write to file
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE);
} else {
// saveAccelerationDataToExternalStorage(jsonArray);
sendAccelerationDataToServer(jsonArray);
}
// if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
// != PackageManager.PERMISSION_GRANTED) {
// ActivityCompat.requestPermissions(this,
// new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
// PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE);
// } else {
// saveAccelerationDataToExternalStorage(jsonArray); //TODO: uncomment if needed to write to file
sendAccelerationDataToServer(jsonArray);
// }
}
private void saveAccelerationDataToExternalStorage(JSONArray jsonArray) {
......
......@@ -8,6 +8,7 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.ConcatAdapter;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
......@@ -21,6 +22,7 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.TelematicsHistory;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.TelematicsHistoryAdapter;
import ly.warp.sdk.views.adapters.TelematicsHistoryHeaderAdapter;
/**
* Created by Panagiotis Triantafyllou on 07/Aug/2023.
......@@ -39,6 +41,7 @@ public class TelematicsHistoryActivity extends Activity implements View.OnClickL
private LinearLayout mLlTelematicsHistoryMain;
private ArrayList<TelematicsHistory> mTelematicsHistoryData = new ArrayList<>();
private TelematicsHistoryAdapter mAdapterTelematicsHistory;
private TelematicsHistoryHeaderAdapter mAdapterTelematicsHistoryHeader;
private boolean mTelematicsHistoryItemPressed = false;
private ImageView mIvClose;
......@@ -85,8 +88,10 @@ public class TelematicsHistoryActivity extends Activity implements View.OnClickL
private void initViews() {
if (mTelematicsHistoryData != null && mTelematicsHistoryData.size() > 0) {
mRvTripHistory.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterTelematicsHistoryHeader = new TelematicsHistoryHeaderAdapter(this);
mAdapterTelematicsHistory = new TelematicsHistoryAdapter(this, mTelematicsHistoryData);
mRvTripHistory.setAdapter(mAdapterTelematicsHistory);
ConcatAdapter concatAdapter = new ConcatAdapter(mAdapterTelematicsHistoryHeader, mAdapterTelematicsHistory);
mRvTripHistory.setAdapter(concatAdapter);
mAdapterTelematicsHistory.getPositionClicks()
.doOnNext(historyItem -> {
if (!mTelematicsHistoryItemPressed) {
......
......@@ -8,15 +8,13 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.TelematicsHistory;
import ly.warp.sdk.io.models.TripMetrics;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -36,9 +34,9 @@ public class TelematicsMetricsActivity extends Activity implements View.OnClickL
private LinearLayout mLlTelematicsMetricsMain;
private ImageView mIvClose, mIvRatePositive, mIvRateNegative;
private int mTripId = -1;
private TextView mTvAvgSpeed, mTvNumOfTrips, mTvAccScore, mTvFocusScore, mTvReadinessScore,
mTvSmoothnessScore, mTVTotalKM;
private TripMetrics mTripMetrics;
private CardView mCvAvgSpeed, mCvTrips, mCvAccScore, mCvFocusScore, mCvReadinessScore,
mCvSmoothnessScore, mCvTotalDistance;
// ===========================================================
......@@ -53,17 +51,17 @@ public class TelematicsMetricsActivity extends Activity implements View.OnClickL
mLlTelematicsMetricsMain = findViewById(R.id.ll_telematics_metrics_main);
mIvClose = findViewById(R.id.iv_metrics_close);
mIvClose.setOnClickListener(this);
mTvAvgSpeed = findViewById(R.id.tv_metrics_speed_value);
mTvNumOfTrips = findViewById(R.id.tv_metrics_trips_value);
mTvAccScore = findViewById(R.id.tv_metrics_acceleration_value);
mTvFocusScore = findViewById(R.id.tv_metrics_focus_value);
mTvReadinessScore = findViewById(R.id.tv_metrics_readiness_value);
mTvSmoothnessScore = findViewById(R.id.tv_metrics_smoothness_value);
mTVTotalKM = findViewById(R.id.tv_metrics_total_value);
mIvRatePositive = findViewById(R.id.iv_rate_positive);
mIvRateNegative = findViewById(R.id.iv_rate_negative);
mIvRatePositive.setOnClickListener(this);
mIvRateNegative.setOnClickListener(this);
mCvAvgSpeed = findViewById(R.id.ly_avg_speed);
mCvTrips = findViewById(R.id.ly_trips);
mCvAccScore = findViewById(R.id.ly_acc_score);
mCvFocusScore = findViewById(R.id.ly_focus_score);
mCvReadinessScore = findViewById(R.id.ly_readiness_score);
mCvSmoothnessScore = findViewById(R.id.ly_smoothness_score);
mCvTotalDistance = findViewById(R.id.ly_total_distance);
if (mTripId > -1)
WarplyManager.getTripMetrics(mTripId, mTripMetricsCallback);
......@@ -101,13 +99,40 @@ public class TelematicsMetricsActivity extends Activity implements View.OnClickL
private void initViews() {
if (mTripMetrics != null) {
mTvAvgSpeed.setText(String.valueOf(mTripMetrics.getAvgSpeed()));
mTvNumOfTrips.setText(String.valueOf(mTripMetrics.getNumOfTrips()));
mTvAccScore.setText(String.valueOf(mTripMetrics.getOverallScore()));
mTvFocusScore.setText(String.valueOf(mTripMetrics.getOverallFocus()));
mTvReadinessScore.setText(String.valueOf(mTripMetrics.getReadinessScore()));
mTvSmoothnessScore.setText(String.valueOf(mTripMetrics.getSmoothnessScore()));
mTVTotalKM.setText(String.valueOf(mTripMetrics.getTotalKM()));
TextView mCvAvgSpeedText = mCvAvgSpeed.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvAvgSpeedSubtitleText = mCvAvgSpeed.findViewById(R.id.tv_telematics_metric_subtitle);
mCvAvgSpeedText.setText(String.valueOf(mTripMetrics.getAvgSpeed()));
mCvAvgSpeedSubtitleText.setText("Average Speed");
TextView mCvTripsText = mCvTrips.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvTripsSubtitleText = mCvTrips.findViewById(R.id.tv_telematics_metric_subtitle);
mCvTripsText.setText(String.valueOf(mTripMetrics.getNumOfTrips()));
mCvTripsSubtitleText.setText("Trips");
TextView mCvAccScoreText = mCvAccScore.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvAccScoreSubtitleText = mCvAccScore.findViewById(R.id.tv_telematics_metric_subtitle);
mCvAccScoreText.setText(String.valueOf(mTripMetrics.getOverallScore()));
mCvAccScoreSubtitleText.setText("Acceleration Score");
TextView mCvFocusScoreText = mCvFocusScore.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvFocusScoreSubtitleText = mCvFocusScore.findViewById(R.id.tv_telematics_metric_subtitle);
mCvFocusScoreText.setText(String.valueOf(mTripMetrics.getOverallFocus()));
mCvFocusScoreSubtitleText.setText("Focus Score");
TextView mCvReadinessScoreText = mCvReadinessScore.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvReadinessScoreSubtitleText = mCvReadinessScore.findViewById(R.id.tv_telematics_metric_subtitle);
mCvReadinessScoreText.setText(String.valueOf(mTripMetrics.getReadinessScore()));
mCvReadinessScoreSubtitleText.setText("Readiness Score");
TextView mCvSmoothnessScoreText = mCvSmoothnessScore.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvSmoothnessScoreSubtitleText = mCvSmoothnessScore.findViewById(R.id.tv_telematics_metric_subtitle);
mCvSmoothnessScoreText.setText(String.valueOf(mTripMetrics.getSmoothnessScore()));
mCvSmoothnessScoreSubtitleText.setText("Smoothness Score");
TextView mCvTotalDistanceText = mCvTotalDistance.findViewById(R.id.tv_telematics_metric_title_value);
TextView mCvTotalDistanceSubtitleText = mCvTotalDistance.findViewById(R.id.tv_telematics_metric_subtitle);
mCvTotalDistanceText.setText(String.valueOf(mTripMetrics.getTotalKM()));
mCvTotalDistanceSubtitleText.setText("Total Distance");
}
}
......
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.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.CouponsetsList;
import ly.warp.sdk.io.models.TelematicsHistory;
public class TelematicsHistoryAdapter extends RecyclerView.Adapter<TelematicsHistoryAdapter.CouponsetViewHolder> {
public class TelematicsHistoryAdapter extends RecyclerView.Adapter<TelematicsHistoryAdapter.TelematicsViewHolder> {
private Context mContext;
private ArrayList<TelematicsHistory> mHistory;
......@@ -40,10 +30,10 @@ public class TelematicsHistoryAdapter extends RecyclerView.Adapter<TelematicsHis
this.mHistory = history;
}
public class CouponsetViewHolder extends RecyclerView.ViewHolder {
public class TelematicsViewHolder extends RecyclerView.ViewHolder {
private TextView tvHistoryId, tvHistoryDate;
public CouponsetViewHolder(View view) {
public TelematicsViewHolder(View view) {
super(view);
tvHistoryId = view.findViewById(R.id.tv_telematics_history_value);
tvHistoryDate = view.findViewById(R.id.tv_telematics_history_date_value);
......@@ -69,21 +59,21 @@ public class TelematicsHistoryAdapter extends RecyclerView.Adapter<TelematicsHis
}
@Override
public CouponsetViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public TelematicsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.telematics_history_layout, parent, false);
return new CouponsetViewHolder(itemView);
return new TelematicsViewHolder(itemView);
}
@Override
public void onBindViewHolder(final CouponsetViewHolder holder, int position) {
public void onBindViewHolder(final TelematicsViewHolder holder, int position) {
TelematicsHistory historyItem = mHistory.get(position);
if (position % 2 == 0) {
holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.grey_light));
} else {
holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.white));
}
// if (position % 2 == 0) {
// holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.grey_light));
// } else {
// holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.white));
// }
if (historyItem != null) {
holder.tvHistoryId.setText(String.valueOf(historyItem.getTripId()));
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import ly.warp.sdk.R;
public class TelematicsHistoryHeaderAdapter extends RecyclerView.Adapter<TelematicsHistoryHeaderAdapter.TelematicsHeaderViewHolder> {
private Context mContext;
public TelematicsHistoryHeaderAdapter(Context mContext) {
this.mContext = mContext;
}
public class TelematicsHeaderViewHolder extends RecyclerView.ViewHolder {
public TelematicsHeaderViewHolder(View view) {
super(view);
}
}
@Override
public int getItemCount() {
return 1;
}
@Override
public TelematicsHeaderViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.telematics_history_header_layout, parent, false);
return new TelematicsHeaderViewHolder(itemView);
}
@Override
public void onBindViewHolder(final TelematicsHeaderViewHolder holder, int position) {
}
}
......@@ -40,7 +40,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
......@@ -54,7 +54,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_light_grey3"
android:gravity="center_horizontal">
android:gravity="center_horizontal"
android:visibility="gone">
<TextView
android:id="@+id/tv_sensor_data_label"
......@@ -211,6 +212,7 @@
android:layout_marginTop="24dp"
android:hint="Cut off in m/s^2"
android:inputType="phone"
android:text="50"
android:textColor="@color/blue_dark"
android:textSize="16sp" />
......@@ -225,10 +227,119 @@
android:hint="Sample Interval in ms"
android:inputType="phone"
android:paddingEnd="24dp"
android:text="2000"
android:textColor="@color/blue_dark"
android:textSize="16sp" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="48dp"
app:cardCornerRadius="4dp"
app:cardElevation="15dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="24dp"
android:layout_marginVertical="16dp"
android:background="@color/white">
<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_insurance_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/cosmote_insurance_logo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_driving_sum"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/cos_telematics_sum"
android:textColor="@color/cos_dark_blue"
android:textSize="22sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_60_percent"
app:layout_constraintStart_toStartOf="@+id/iv_insurance_logo"
app:layout_constraintTop_toBottomOf="@+id/iv_insurance_logo" />
<TextView
android:id="@+id/tv_driving_sum_subtitle"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/cos_telematics_sum_subtitle"
android:textColor="@color/cos_dark_blue"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_60_percent"
app:layout_constraintStart_toStartOf="@+id/tv_driving_sum"
app:layout_constraintTop_toBottomOf="@+id/tv_driving_sum" />
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/telematics_score"
app:layout_constraintBottom_toBottomOf="@+id/tv_driving_sum_subtitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_insurance_logo" />
<View
android:id="@+id/v_seperator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="@color/cos_grey_line_tr"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_driving_sum_subtitle" />
<LinearLayout
android:id="@+id/ll_telematics_history"
android:layout_width="140dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:background="@drawable/selector_button_grey"
android:gravity="center"
android:orientation="horizontal"
android:paddingVertical="8dp"
app:layout_constraintStart_toStartOf="@+id/v_seperator"
app:layout_constraintTop_toBottomOf="@+id/v_seperator">
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_telematics_history"
android:textColor="@color/cos_green6"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:layout_width="110dp"
android:layout_height="60dp"
android:src="@drawable/telematics_score_rating"
app:layout_constraintBottom_toBottomOf="@+id/ll_telematics_history"
app:layout_constraintEnd_toEndOf="@+id/v_seperator"
app:layout_constraintTop_toTopOf="@+id/ll_telematics_history" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:id="@+id/ll_activate_button"
android:layout_width="match_parent"
......@@ -236,19 +347,19 @@
android:layout_below="@+id/et_acceleration"
android:layout_marginHorizontal="24dp"
android:layout_marginVertical="56dp"
android:background="@drawable/selector_button_green_border"
android:background="@drawable/selector_button_grey"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_trip_button"
fontPath="fonts/PeridotPE-SemiBold.ttf"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_dlg_start_trip"
android:textColor="@color/blue_dark"
android:textColor="@color/cos_green6"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
......
......@@ -4,7 +4,7 @@
android:id="@+id/ll_telematics_history_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="@color/cos_light_grey3"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -46,6 +46,6 @@
android:clipToPadding="false"
android:orientation="vertical"
android:overScrollMode="never"
android:paddingVertical="16dp"
android:paddingBottom="16dp"
android:scrollbars="none" />
</LinearLayout>
\ No newline at end of file
......
......@@ -4,7 +4,7 @@
android:id="@+id/ll_telematics_metrics_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="@color/cos_light_grey3"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -39,212 +39,157 @@
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:scrollbars="none">
<TextView
android:id="@+id/tv_metrics_speed_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="AVG_SPEED: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_speed_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_trips_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="NUM_OF_TRIPS: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_trips_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_acceleration_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="ACC_SCORE: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_acceleration_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_focus_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="FOCUS_SCORE: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_focus_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_readiness_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="READINESS_SCORE: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_readiness_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_smoothness_title"
fontPath="fonts/PeridotPE-Regularttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="SMOOTHNESS_SCORE: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_smoothness_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_metrics_total_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="TOTAL_KM: "
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_metrics_total_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_metrics_total_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="64dp"
android:text="Rate"
android:textColor="@color/cos_light_black"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_rate_positive"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="16dp"
android:src="@drawable/rate_positive" />
<ImageView
android:id="@+id/iv_rate_negative"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:src="@drawable/rate_negative" />
</LinearLayout>
android:orientation="vertical">
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:text="@string/cos_telematics_history_analysis_title"
android:textColor="@color/grey"
android:textSize="18sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_50_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_25_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.25" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_75_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.75" />
<include
android:id="@+id/ly_avg_speed"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_50_percent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/ly_trips"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_50_percent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/ly_acc_score"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_50_percent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ly_avg_speed" />
<include
android:id="@+id/ly_focus_score"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_50_percent"
app:layout_constraintTop_toBottomOf="@+id/ly_trips" />
<include
android:id="@+id/ly_readiness_score"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_50_percent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ly_acc_score" />
<include
android:id="@+id/ly_smoothness_score"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_50_percent"
app:layout_constraintTop_toBottomOf="@+id/ly_focus_score" />
<include
android:id="@+id/ly_total_distance"
layout="@layout/telematics_metric_item_layout"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginTop="8dp"
android:layout_marginHorizontal="8dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_75_percent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_25_percent"
app:layout_constraintTop_toBottomOf="@+id/ly_smoothness_score" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="36dp"
android:text="@string/cos_telematics_history_analysis_rate"
android:textColor="@color/grey"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_rate_negative"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginEnd="16dp"
android:src="@drawable/rate_negative" />
<ImageView
android:id="@+id/iv_rate_positive"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginStart="16dp"
android:src="@drawable/rate_positive" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
......
......@@ -138,6 +138,7 @@
android:layout_below="@+id/rl_driving"
android:layout_marginHorizontal="8dp"
android:layout_marginBottom="16dp"
android:visibility="gone"
android:background="@drawable/shape_cos_white">
<TextView
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="255dp"
android:layout_marginBottom="8dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/telematics_history_header" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.cardview.widget.CardView 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="match_parent"
android:layout_height="60dp"
android:background="@color/grey_light"
android:paddingVertical="8dp">
android:layout_height="100dp"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="16dp"
app:cardCornerRadius="4dp"
app:cardElevation="5dp">
<TextView
android:id="@+id/tv_telematics_history_title"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:ellipsize="end"
android:maxLines="1"
android:text="TRIP ID"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<TextView
android:id="@+id/tv_telematics_history_value"
fontPath="fonts/BTCosmo-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_telematics_history_title"
app:layout_constraintStart_toStartOf="@+id/tv_telematics_history_title"
tools:text="1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_telematics_open"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:rotation="180"
android:scaleType="centerInside"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_telematics_history_title"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TRIP ID"
android:textColor="@color/grey"
android:textSize="18sp" />
<TextView
android:id="@+id/tv_telematics_history_date_title"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:text="CREATED"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/iv_telematics_open"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_telematics_history_value"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/grey"
android:textSize="18sp"
tools:text="1000" />
</LinearLayout>
<TextView
android:id="@+id/tv_telematics_history_date_value"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tv_telematics_history_date_title"
app:layout_constraintStart_toStartOf="@+id/tv_telematics_history_date_title"
tools:text="07/08/2023" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<TextView
android:id="@+id/tv_telematics_history_date_value"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:textColor="@color/grey"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="07/08/2023" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="match_parent"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp"
app:cardElevation="5dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center_horizontal"
android:paddingHorizontal="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_telematics_metric_title_value"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/grey"
android:textSize="22sp"
tools:text="52" />
<TextView
android:id="@+id/tv_telematics_metric_title"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/grey"
android:textSize="18sp"
tools:text="km/h" />
</LinearLayout>
<TextView
android:id="@+id/tv_telematics_metric_subtitle"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textColor="@color/grey"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="Average km/h" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
......@@ -74,4 +74,5 @@
<color name="cos_grey_dark2">#32485A</color>
<color name="cos_blue6">#004B87</color>
<color name="cos_skyblue4">#B8E0EF</color>
<color name="cos_grey_line_tr">#40A9A9A9</color>
</resources>
\ No newline at end of file
......
......@@ -176,13 +176,17 @@
<string name="lbl_take_photo_accept">Οκ</string>
<string name="lbl_take_photo_decline">Άκυρο</string>
<string name="lbl_gps_enabled">Θέλετε να ενεργοποιήσετε το GPS;</string>
<string name="cos_telematics">Telematics Demo</string>
<string name="cos_telematics_history">Telematics History</string>
<string name="cos_telematics_metrics">Telematics Trip Metrics</string>
<string name="cos_dlg_start_trip">Start Trip</string>
<string name="cos_dlg_stop_trip">Stop Trip</string>
<string name="cos_telematics">Safe Driving</string>
<string name="cos_telematics_metrics">Ανάλυση</string>
<string name="cos_dlg_start_trip">Έναρξη</string>
<string name="cos_dlg_stop_trip">Παύση</string>
<string name="cos_dlg_no_internet_title">Δεν υπάρχει σύνδεση</string>
<string name="cos_dlg_no_internet_subtitle">Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.</string>
<string name="cos_telematics_sum">Συνολική Επίδοση Οδήγησης</string>
<string name="cos_telematics_sum_subtitle">Βρίσκεστε στο top 65% των οδηγών</string>
<string name="cos_telematics_history">Ιστορικό</string>
<string name="cos_telematics_history_analysis_title">Ανάλυση παραμέτρων ασφαλούς οδήγησης</string>
<string name="cos_telematics_history_analysis_rate">Αξιολογήστε την ανάλυση</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......