Fix alignment in grid mode

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-11-06 12:07:53 +01:00
parent 87a420f186
commit 5256b62484
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
4 changed files with 34 additions and 37 deletions

View file

@ -388,12 +388,12 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
}
private void checkLivePhotoAbility(ListGridImageViewHolder holder, OCFile file) {
private void checkLivePhotoAvailability(ListGridImageViewHolder holder, OCFile file) {
holder.getLivePhotoIndicator().setVisibility((file.isLivePhoto()) ? (View.VISIBLE) : (View.GONE));
}
private void bindListItemViewHolder(ListItemViewHolder holder, OCFile file) {
checkLivePhotoAbility(holder, file);
checkLivePhotoAvailability(holder, file);
if ((file.isSharedWithMe() || file.isSharedWithSharee()) && !isMultiSelect() && !gridView &&
!hideItemOptions) {
@ -507,7 +507,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
private void bindListGridItemViewHolder(ListGridItemViewHolder holder, OCFile file) {
checkLivePhotoAbility(holder, file);
checkLivePhotoAvailability(holder, file);
holder.getFileName().setText(file.getDecryptedFileName());
boolean gridImage = MimeTypeUtil.isImage(file) || MimeTypeUtil.isVideo(file);

View file

@ -17,6 +17,7 @@
-->
<FrameLayout 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/ListItemLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -91,19 +92,19 @@
<TextView
android:id="@+id/live_photo_indicator"
tools:visibility="visible"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/standard_quarter_margin"
android:layout_marginRight="@dimen/standard_quarter_margin"
android:text="@string/file_list_live"
android:drawablePadding="@dimen/standard_eight_padding"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:gravity="center"
android:layout_marginEnd="@dimen/standard_double_margin"
android:layout_marginBottom="@dimen/standard_quarter_margin"
android:layout_gravity="bottom|end"
android:layout_gravity="center_vertical|bottom"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="@dimen/two_line_secondary_text_size"
app:drawableLeftCompat="@drawable/ic_play_circle" />
app:drawableTopCompat="@drawable/ic_play_circle" />
<ImageView
android:id="@+id/custom_checkbox"

View file

@ -29,6 +29,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:contentDescription="Ignore live photo indicator for folder"
android:id="@+id/live_photo_indicator"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="12dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/frameLayout"
app:layout_constraintEnd_toStartOf="@+id/favorite_action"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/favorite_action"
android:layout_width="wrap_content"
@ -72,12 +83,12 @@
android:id="@+id/videoOverlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:contentDescription="@string/video_overlay_icon"
android:src="@drawable/video_white"
android:visibility="gone"
tools:visibility="visible"
android:contentDescription="@string/video_overlay_icon" />
tools:visibility="visible" />
</FrameLayout>
@ -88,19 +99,19 @@
android:layout_gravity="top|end"
android:layout_marginTop="@dimen/grid_item_shared_icon_layout_top_margin"
android:layout_marginEnd="@dimen/standard_quarter_margin"
android:src="@drawable/shared_via_link"
android:contentDescription="@string/shared_icon_shared_via_link" />
android:contentDescription="@string/shared_icon_shared_via_link"
android:src="@drawable/shared_via_link" />
<ImageView
android:id="@+id/unreadComments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:contentDescription="@string/unread_comments"
android:focusable="true"
android:layout_gravity="top|end"
android:layout_marginTop="@dimen/grid_item_shared_icon_layout_top_margin"
android:layout_marginEnd="@dimen/standard_quarter_margin"
android:clickable="true"
android:contentDescription="@string/unread_comments"
android:focusable="true"
android:src="@drawable/ic_comment_grid"
android:visibility="gone" />
@ -109,37 +120,21 @@
android:layout_width="@dimen/grid_item_local_file_indicator_layout_width"
android:layout_height="@dimen/grid_item_local_file_indicator_layout_height"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/standard_quarter_margin"
android:layout_marginEnd="@dimen/standard_quarter_margin"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:src="@drawable/ic_synced"
android:contentDescription="@string/synced_icon"/>
<TextView
android:id="@+id/live_photo_indicator"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_list_live"
android:drawablePadding="@dimen/standard_eight_padding"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:gravity="center"
android:layout_marginEnd="@dimen/standard_quarter_margin"
android:layout_marginBottom="@dimen/standard_quarter_margin"
android:layout_gravity="bottom|start"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="@dimen/two_line_secondary_text_size"
app:drawableLeftCompat="@drawable/ic_play_circle" />
android:contentDescription="@string/synced_icon"
android:src="@drawable/ic_synced" />
<ImageView
android:id="@+id/custom_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|top"
android:layout_marginLeft="@dimen/standard_quarter_margin"
android:layout_marginRight="@dimen/standard_quarter_margin"
android:layout_gravity="center_vertical|top"
android:src="@android:drawable/checkbox_off_background"
android:contentDescription="@string/checkbox"/>
android:contentDescription="@string/checkbox"
android:src="@android:drawable/checkbox_off_background" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -167,6 +167,7 @@
<TextView
android:id="@+id/live_photo_indicator"
android:visibility="gone"
tools:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_list_live"