diff options
author | Stefan Niedermann <info@niedermann.it> | 2021-04-26 20:32:46 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2021-04-26 21:08:29 +0300 |
commit | e7757443af6d4c53abd7b3dfb0f253b482dd0eeb (patch) | |
tree | 064ed613d2e85da9be82ccc03d813611f3c0429d /News-Android-App/src/main/res/layout | |
parent | 9c3df5ac933cdbaa514786e9f0dd30e647d8db25 (diff) |
#865 Display avatar of the current user account in the top right
Diffstat (limited to 'News-Android-App/src/main/res/layout')
-rw-r--r-- | News-Android-App/src/main/res/layout/fragment_newsreader_list.xml | 77 | ||||
-rw-r--r-- | News-Android-App/src/main/res/layout/toolbar_layout.xml | 33 |
2 files changed, 61 insertions, 49 deletions
diff --git a/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml b/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml index d7af31b7..2f030f53 100644 --- a/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml +++ b/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml @@ -2,84 +2,77 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - xmlns:tools="http://schemas.android.com/tools" android:background="@color/app_drawer_feed_list_background_color"> <!-- TODO: make header scroll up with listview --> - <RelativeLayout + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/header_view" android:layout_width="match_parent" android:layout_height="100dp" - android:padding="10dp" - android:background="@drawable/nextcloud" + android:background="@color/nextcloudBlue" android:clickable="true" - android:focusable="true"> + android:focusable="true" + android:padding="10dp"> <TextView + android:id="@+id/appName" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - tools:text='Username' - android:id="@+id/userTextView" - android:textColor="@android:color/white" - android:layout_above="@+id/urlTextView" + android:layout_marginStart="@dimen/spacer_2x" android:layout_toEndOf="@+id/header_logo" android:ellipsize="end" - android:singleLine="true" /> - - <TextView - android:id="@+id/urlTextView" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - tools:text='https://url_to_owncloud.oc' - android:textColor="@android:color/white" - android:layout_alignParentBottom="true" - android:paddingBottom="5dp" - android:layout_toEndOf="@+id/header_logo" + android:fontFamily="sans-serif-light" + android:gravity="center_vertical" android:singleLine="true" - android:ellipsize="end" /> + android:text="@string/app_name" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="@android:color/white" + android:textSize="24sp" + app:layout_constraintBottom_toBottomOf="@id/header_logo" + app:layout_constraintStart_toEndOf="@id/header_logo" + app:layout_constraintTop_toTopOf="@id/header_logo" /> <ImageView - android:layout_width="48dp" - android:layout_height="48dp" android:id="@+id/header_logo" - android:background="@drawable/shadow" - android:layout_alignBottom="@+id/urlTextView" - android:layout_alignParentStart="true" - android:src="@mipmap/ic_launcher" - android:layout_marginEnd="10dp" - android:contentDescription="@string/content_desc_tap_to_refresh"/> + android:layout_width="56dp" + android:layout_height="56dp" + android:layout_marginStart="@dimen/spacer_1x" + android:contentDescription="@string/content_desc_tap_to_refresh" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_launcher_foreground" /> <ProgressBar android:id="@+id/header_logo_progress" style="?android:attr/progressBarStyle" - android:layout_width="48dp" - android:layout_height="48dp" - android:layout_alignParentBottom="true" - android:layout_alignParentStart="true" - android:indeterminateTint="@android:color/white" - android:indeterminateTintMode="src_in" + android:layout_width="56dp" + android:layout_height="56dp" android:layout_gravity="center" android:indeterminate="true" - android:padding="7dp" /> + android:indeterminateTint="@android:color/white" + android:indeterminateTintMode="src_in" + app:layout_constraintBottom_toBottomOf="@id/header_logo" + app:layout_constraintEnd_toEndOf="@id/header_logo" + app:layout_constraintStart_toStartOf="@id/header_logo" + app:layout_constraintTop_toTopOf="@id/header_logo" /> - </RelativeLayout> + </androidx.constraintlayout.widget.ConstraintLayout> <de.luhmer.owncloudnewsreader.ListView.BlockingExpandableListView android:id="@+id/expandableListView" android:layout_width="match_parent" android:layout_height="match_parent" - android:divider="@null" - android:layout_below="@+id/header_view" android:layout_above="@id/navigationMenu" - /> + android:layout_below="@+id/header_view" + android:divider="@null" /> <com.google.android.material.navigation.NavigationView android:id="@+id/navigationMenu" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/navigationview_bg" android:layout_alignParentBottom="true" + android:background="@drawable/navigationview_bg" app:menu="@menu/drawer_menu" /> diff --git a/News-Android-App/src/main/res/layout/toolbar_layout.xml b/News-Android-App/src/main/res/layout/toolbar_layout.xml index 7cb7cbb2..ddf233cb 100644 --- a/News-Android-App/src/main/res/layout/toolbar_layout.xml +++ b/News-Android-App/src/main/res/layout/toolbar_layout.xml @@ -1,14 +1,33 @@ <?xml version="1.0" encoding="utf-8"?> <com.google.android.material.appbar.AppBarLayout 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="wrap_content" - xmlns:app="http://schemas.android.com/apk/res-auto"> + android:layout_height="wrap_content"> - <androidx.appcompat.widget.Toolbar - android:id="@+id/toolbar" + <LinearLayout android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:theme="@style/ToolbarTheme" - app:popupTheme="@style/ToolbarOptionMenuBackgroundTheme"/> + android:layout_height="wrap_content"> + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="0dp" + android:layout_height="?attr/actionBarSize" + android:layout_weight="1" + android:theme="@style/ToolbarTheme" + app:popupTheme="@style/ToolbarOptionMenuBackgroundTheme" /> + + <ImageButton + android:id="@+id/avatar" + android:layout_width="48dp" + android:layout_height="48dp" + android:layout_gravity="center" + android:layout_marginEnd="@dimen/spacer_1x" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/switch_account" + android:padding="@dimen/spacer_1x" + android:visibility="gone" + app:srcCompat="@drawable/ic_baseline_account_circle_24" + tools:visibility="visible" /> + </LinearLayout> </com.google.android.material.appbar.AppBarLayout>
\ No newline at end of file |