Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Tobias Kaminsky 2023-05-13 02:32:33 +02:00
commit 7b8ff91156
7 changed files with 21 additions and 11 deletions

View file

@ -242,7 +242,7 @@ dependencies {
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.5' // remove after entire switch to lib v2
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation 'androidx.webkit:webkit:1.6.1'
@ -367,7 +367,7 @@ dependencies {
// upon each update first test: new registration, receive push
gplayImplementation "com.google.firebase:firebase-messaging:23.1.2"
implementation 'com.github.nextcloud.android-common:ui:0.8.0'
implementation 'com.github.nextcloud.android-common:ui:0.10.0'
implementation "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"

View file

@ -25,6 +25,7 @@ import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipGroup
import com.owncloud.android.ui.AvatarGroupLayout
@ -35,8 +36,8 @@ internal interface ListItemViewHolder : ListGridItemViewHolder {
val overflowMenu: ImageView
val sharedAvatars: AvatarGroupLayout
val tagsGroup: ChipGroup
val firstTag: TextView
val secondTag: TextView
val tagMore: TextView
val firstTag: Chip
val secondTag: Chip
val tagMore: Chip
val fileDetailGroup: LinearLayout
}

View file

@ -425,6 +425,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
} else {
holder.getTagsGroup().setVisibility(View.VISIBLE);
holder.getFileDetailGroup().setVisibility(View.GONE);
viewThemeUtils.material.themeChipSuggestion(holder.getFirstTag());
holder.getFirstTag().setVisibility(View.VISIBLE);
holder.getSecondTag().setVisibility(View.GONE);
holder.getTagMore().setVisibility(View.GONE);
@ -432,11 +433,13 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
holder.getFirstTag().setText(file.getTags().get(0));
if (file.getTags().size() > 1) {
viewThemeUtils.material.themeChipSuggestion(holder.getSecondTag());
holder.getSecondTag().setVisibility(View.VISIBLE);
holder.getSecondTag().setText(file.getTags().get(1));
}
if (file.getTags().size() > 2) {
viewThemeUtils.material.themeChipSuggestion(holder.getTagMore());
holder.getTagMore().setVisibility(View.VISIBLE);
holder.getTagMore().setText(String.format(activity.getString(R.string.tags_more),
(file.getTags().size() - 2)));

View file

@ -27,6 +27,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.elyeproj.loaderviewlibrary.LoaderImageView
import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipGroup
import com.owncloud.android.databinding.ListItemBinding
import com.owncloud.android.ui.AvatarGroupLayout
@ -52,11 +53,11 @@ internal class OCFileListItemViewHolder(private var binding: ListItemBinding) :
get() = binding.thumbnailLayout.thumbnail
override val tagsGroup: ChipGroup
get() = binding.tagsGroup
override val firstTag: TextView
override val firstTag: Chip
get() = binding.firstTag
override val secondTag: TextView
override val secondTag: Chip
get() = binding.secondTag
override val tagMore: TextView
override val tagMore: Chip
get() = binding.tagMore
override val fileDetailGroup: LinearLayout
get() = binding.fileDetailGroup

View file

@ -242,8 +242,11 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
chip.setText(tag);
chip.setChipBackgroundColor(ColorStateList.valueOf(getResources().getColor(R.color.bg_default,
context.getTheme())));
chip.setTextColor(getResources().getColor(R.color.list_item_lastmod_and_filesize_text,
context.getTheme()));
chip.setShapeAppearanceModel(chip.getShapeAppearanceModel().toBuilder().setAllCornerSizes((100.0f))
.build());
chip.setEnsureMinTouchTargetSize(false);
chip.setClickable(false);
viewThemeUtils.material.themeChipSuggestion(chip);
binding.tagsGroup.addView(chip);
}
}

View file

@ -116,7 +116,8 @@
android:id="@+id/tagsGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:paddingTop="@dimen/standard_half_padding"
app:chipSpacingVertical="@dimen/standard_half_padding" />
</LinearLayout>

View file

@ -237,6 +237,7 @@
<string name="drawer_item_all_files">所有檔案</string>
<string name="drawer_item_favorites">最愛</string>
<string name="drawer_item_gallery">多媒體</string>
<string name="drawer_item_groupfolders">群組資料夾</string>
<string name="drawer_item_home">家目錄</string>
<string name="drawer_item_notifications">通知</string>
<string name="drawer_item_on_device">在裝置上</string>