bgabriel998/SoftwareDevProject

View on GitHub
app/src/main/res/layout/top_bar.xml

Summary

Maintainability
Test Coverage
<?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:id="@+id/top_bar"
    android:layout_width="match_parent"
    android:layout_height="40dp"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <!-- Profile button background on camera -->
    <ImageView
        android:id="@+id/profile_background"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:src="@drawable/ic_circle_background"
        app:layout_constraintStart_toStartOf="@+id/top_bar_profile_button"
        app:layout_constraintTop_toTopOf="@+id/top_bar_profile_button"
        app:layout_constraintBottom_toBottomOf="@+id/top_bar_profile_button"
        app:layout_constraintEnd_toEndOf="@+id/top_bar_profile_button"
        android:background="@null"
        android:contentDescription="@string/description_profile_button"
        android:visibility="invisible"/>

    <!-- Profile button -->
    <ImageButton
        android:id="@+id/top_bar_profile_button"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:src="@drawable/top_bar_user"
        android:layout_marginStart="10dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:background="@null"
        android:contentDescription="@string/description_profile_button"/>

    <!-- Title -->
    <TextView
        android:id="@+id/top_bar_title"
        style="@style/SmallText.DarkGreen"
        android:layout_width="300dp"
        android:layout_height="21dp"
        android:layout_marginStart="40dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"/>

    <!-- Sort dots -->
    <ImageButton
        android:id="@+id/top_bar_dots_button"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:src="@drawable/general_icon_dots"
        android:layout_marginEnd="10dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:background="@null"
        android:contentDescription="@string/description_sort_button"/>

    <!-- Switch Container -->
    <LinearLayout
        android:id="@+id/top_bar_switch"
        android:layout_width="180dp"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <!-- Switch Left Text -->
        <TextView
            android:id="@+id/top_bar_switch_text_left"
            style="@style/SmallText"
            android:layout_width="55dp"
            android:layout_height="21dp"
            android:gravity="end"
            android:text="All" />

        <!-- Switch Button -->
        <androidx.appcompat.widget.SwitchCompat
            android:id="@+id/top_bar_switch_button"
            android:layout_width="60dp"
            android:layout_height="wrap_content"
            app:trackTint="@color/DarkGreen"
            app:thumbTint="@color/LightGrey"
            app:switchMinWidth="15dp"/>

        <!-- Switch Right Text -->
        <TextView
            android:id="@+id/top_bar_switch_text_right"
            style="@style/SmallText"
            android:layout_width="55dp"
            android:layout_height="21dp"
            android:text="Friends" />
    </LinearLayout>


</androidx.constraintlayout.widget.ConstraintLayout>