Skip to content

Commit

Permalink
better alignment, cleanup list_header
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jan 7, 2025
1 parent 3964b94 commit a5884ed
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
PreviewTextFragment.setText(headerViewHolder.getHeaderText(), text, null, activity, true, true, viewThemeUtils);
headerViewHolder.getHeaderView().setOnClickListener(v -> ocFileListFragmentInterface.onHeaderClicked());

ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().recommendedFilesLayout, shouldShowRecommendedFiles());
ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().recommendedFilesRecyclerView, shouldShowRecommendedFiles());
ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().recommendedFilesTitle, shouldShowRecommendedFiles());
ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().allFilesTitle, shouldShowRecommendedFiles());

if (shouldShowRecommendedFiles()) {
final var recommendedFilesRecyclerView = headerViewHolder.getBinding().recommendedFilesRecyclerView;
Expand Down
75 changes: 28 additions & 47 deletions app/src/main/res/layout/list_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,53 @@
~ SPDX-FileCopyrightText: 2019 Nextcloud GmbH
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/standard_padding"
android:paddingStart="@dimen/standard_padding"
android:paddingEnd="@dimen/standard_padding"
android:showDividers="none">

<TextView
android:id="@+id/headerText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/zero"
android:layout_marginBottom="@dimen/standard_margin"
android:textColor="@color/text_color" />

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/standard_padding"
android:contentDescription="@null"
android:src="@drawable/preview_markdown_gradient_shape" />

<LinearLayout
android:id="@+id/recommended_files_layout"
android:layout_marginTop="@dimen/recommended_files_layout_margin_top"
android:layout_gravity="bottom"
<TextView
android:id="@+id/recommended_files_title"
android:text="@string/recommended_files_title"
android:textSize="@dimen/large_title_text_size"
android:gravity="center|start"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">

<TextView
android:id="@+id/recommended_files_title"
android:text="@string/recommended_files_title"
android:textSize="@dimen/large_title_text_size"
android:gravity="center|start"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/zero"
android:textColor="@color/text_color" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recommended_files_recycler_view"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/standard_margin"
android:textColor="@color/text_color" />

<TextView
android:id="@+id/all_files_title"
android:text="@string/drawer_item_all_files"
android:textSize="@dimen/large_title_text_size"
android:gravity="center|start"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="@dimen/standard_double_padding"
android:paddingRight="@dimen/standard_padding"
android:paddingBottom="@dimen/zero"
android:textColor="@color/text_color" />
<androidx.recyclerview.widget.RecyclerView
android:layout_marginBottom="@dimen/standard_margin"
android:id="@+id/recommended_files_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

</LinearLayout>
<TextView
android:id="@+id/all_files_title"
android:text="@string/drawer_item_all_files"
android:textSize="@dimen/large_title_text_size"
android:gravity="center|start"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/text_color" />

</FrameLayout>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/recommended_files_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
android:layout_height="@dimen/recommended_files_thumbnail_height"
android:padding="@dimen/standard_padding"
android:background="@drawable/rounded_rect_8dp"
android:backgroundTint="@color/transparent"
android:contentDescription="@string/preview_image_description"
android:src="@drawable/file" />

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/dims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,5 @@
<dimen name="tag_height">18dp</dimen>
<dimen name="recommended_files_thumbnail_height">120dp</dimen>
<dimen name="recommended_files_layout_width">150dp</dimen>
<dimen name="recommended_files_layout_margin_top">180dp</dimen>

<dimen name="large_title_text_size">22sp</dimen>
</resources>

0 comments on commit a5884ed

Please sign in to comment.