meili-epfl/Meili

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

Summary

Maintainability
Test Coverage
<RelativeLayout 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="match_parent"
    android:orientation="vertical"
    tools:context=".profile.ProfileActivity">

    <RelativeLayout
        android:id="@+id/signed_in"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/photo"
            android:layout_width="150dp"
            android:layout_height="175dp"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center_horizontal"
            android:src="@mipmap/meili_launcher" />

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/photo_edit"
            android:layout_width="150dp"
            android:layout_height="175dp"
            android:layout_above="@+id/profile_edit_container"
            android:layout_alignEnd="@id/photo"
            android:contentDescription="@string/button_to_change_profile_picture"
            android:onClick="onProfileButtonClick"
            app:srcCompat="@drawable/ic_baseline_add_photo_alternate_24" />

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/profile_edit_button"
            android:layout_width="150dp"
            android:layout_height="175dp"
            android:layout_alignEnd="@id/photo"
            android:layout_alignBottom="@id/photo"
            android:contentDescription="@string/button_to_edit_profile"
            android:onClick="onProfileButtonClick"
            app:srcCompat="@drawable/ic_baseline_edit_24" />

        <ImageButton
            android:id="@+id/list_friends_button"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_alignParentEnd="true"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="32dp"
            android:background="@drawable/ic_baseline_people_24"
            android:contentDescription="@string/my_friends"
            android:onClick="onProfileButtonClick" />


        <RelativeLayout
            android:id="@+id/profile_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/photo"
            android:weightSum="2">

            <TextView
                android:id="@+id/profile_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginTop="16dp"
                android:layout_marginEnd="32dp"
                android:gravity="center"

                android:textSize="24sp" />

            <TextView
                android:id="@+id/profile_bio"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/profile_name"
                android:layout_marginStart="32dp"
                android:layout_marginTop="16dp"
                android:layout_marginEnd="32dp"
                android:gravity="center"
                android:textSize="14sp" />

            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/profile_bio"
                android:layout_marginStart="32dp"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="32dp"
                android:stretchColumns="*">

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <RelativeLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="8dp">

                        <ImageButton
                            android:id="@+id/profile_favorite_pois_button"
                            android:layout_width="match_parent"
                            android:layout_height="150dp"
                            android:adjustViewBounds="true"
                            android:background="@color/design_default_color_primary"
                            android:contentDescription="@string/profile_favorite_pois_button"
                            android:onClick="onProfileButtonClick"
                            android:padding="32dp"
                            android:scaleType="fitCenter"
                            android:src="@drawable/ic_heart" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_alignParentTop="true"
                            android:paddingStart="8dp"
                            android:paddingTop="8dp"
                            android:paddingEnd="8dp"
                            android:text="@string/profile_poi_history_textview"
                            android:textColor="@color/black"
                            android:textSize="16sp" />
                    </RelativeLayout>

                    <RelativeLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="8dp">


                        <ImageButton
                            android:id="@+id/profile_posts_button"
                            android:layout_width="match_parent"
                            android:layout_height="150dp"
                            android:layout_marginEnd="12dp"
                            android:layout_marginBottom="278dp"
                            android:adjustViewBounds="true"
                            android:background="@color/design_default_color_primary"
                            android:contentDescription="@string/profile_posts_button"
                            android:onClick="onProfileButtonClick"
                            android:padding="32dp"
                            android:scaleType="fitCenter"
                            android:src="@drawable/ic_posts" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_alignParentTop="true"
                            android:paddingStart="8dp"
                            android:paddingTop="8dp"
                            android:paddingEnd="8dp"
                            android:text="@string/profile_posts_textview"
                            android:textColor="@color/black"
                            android:textSize="16sp" />
                    </RelativeLayout>
                </TableRow>

            </TableLayout>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/profile_edit_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/photo"
            android:visibility="invisible">

            <LinearLayout
                android:id="@+id/profile_edit_linear"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

                android:layout_marginStart="32dp"
                android:layout_marginTop="16dp"
                android:layout_marginEnd="32dp"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/profile_name_edit_textview" />

                <EditText
                    android:id="@+id/profile_edit_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="name"
                    android:hint="@string/profile_name_edit_edittext"
                    android:inputType="textPersonName" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/profile_bio_edit_textview" />

                <EditText
                    android:id="@+id/profile_edit_bio"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints=""
                    android:hint="@string/profile_bio_edit_edittext"
                    android:inputType="" />
            </LinearLayout>

            <Button
                android:id="@+id/save"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/profile_edit_linear"
                android:layout_alignEnd="@id/profile_edit_linear"
                android:layout_marginTop="16dp"
                android:onClick="onProfileButtonClick"
                style="@style/Theme.Meili.button"
                android:theme="@style/Theme.Meili.button"
                android:text="@string/save_my_profile" />

            <Button
                android:id="@+id/cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/profile_edit_linear"
                android:layout_marginTop="16dp"
                android:layout_marginEnd="16dp"
                android:layout_toStartOf="@id/save"
                android:onClick="onProfileButtonClick"
                style="@style/Theme.Meili.button"
                android:theme="@style/Theme.Meili.button"
                android:text="@string/profile_edit_cancel" />
        </RelativeLayout>
    </RelativeLayout>

    <com.facebook.login.widget.LoginButton
        android:id="@+id/facebook_sign_in"
        android:layout_width="286dp"
        android:layout_height="46dp"
        android:layout_alignParentEnd="true"
        android:layout_marginTop="405dp"
        android:layout_marginEnd="56dp"
        />

    <Button
        android:id="@+id/sign_in"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:layout_below="@id/facebook_sign_in"
        style="@style/Theme.Meili.button"
        android:theme="@style/Theme.Meili.button"
        android:onClick="onProfileButtonClick"
        android:text="@string/sign_in" />


    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:itemIconTint="@drawable/navigation_selector"
        app:itemTextColor="@drawable/navigation_selector"
        app:menu="@menu/home_navigation_menu" />

    <Button
        android:id="@+id/sign_out"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@id/navigation"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="16dp"
        style="@style/Theme.Meili.button"
        android:theme="@style/Theme.Meili.button"
        android:gravity="center"
        android:onClick="onProfileButtonClick"
        android:text="@string/sign_out" />

    <ImageButton
        android:id="@+id/switch_mode"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_alignParentStart="true"
        android:layout_marginStart="32dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/ic_baseline_change_mode_24"
        android:contentDescription="@string/dark_light_mode_button"
        android:onClick="onProfileButtonClick" />

</RelativeLayout>