diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-21 17:26:41 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-21 17:26:41 +0300 |
commit | 9343be904e3daa3ead65bb79f0447bb017e884f5 (patch) | |
tree | d3e12831d4966f0f057899a8001d249da638f6bb /app/src/main/java/it/niedermann/nextcloud/deck/ui/view | |
parent | 1bfcf09165696e903e80fcba8c5db3e6929c2161 (diff) |
Upgrade dependencies
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/view')
4 files changed, 17 insertions, 22 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/ColorChooser.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/ColorChooser.java index a7e211122..c82f47c9c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/ColorChooser.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/ColorChooser.java @@ -14,23 +14,17 @@ import androidx.annotation.Nullable; import com.google.android.flexbox.FlexboxLayout; import com.skydoves.colorpickerview.listeners.ColorEnvelopeListener; +import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.WidgetColorChooserBinding; import it.niedermann.nextcloud.deck.util.ViewUtil; -import static it.niedermann.android.util.DimensionUtil.dpToPx; - public class ColorChooser extends LinearLayout { - private WidgetColorChooserBinding binding; - - private final FlexboxLayout.LayoutParams params = new FlexboxLayout.LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, - ViewGroup.LayoutParams.WRAP_CONTENT - ); + private final WidgetColorChooserBinding binding; - private Context context; - private String[] colors; + private final Context context; + private final String[] colors; private String selectedColor; private String previouslySelectedColor; @@ -41,7 +35,11 @@ public class ColorChooser extends LinearLayout { super(context, attrs); this.context = context; - params.setMargins(0, dpToPx(context, R.dimen.spacer_1x), 0, 0); + final FlexboxLayout.LayoutParams params = new FlexboxLayout.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT + ); + params.setMargins(0, DimensionUtil.INSTANCE.dpToPx(context, R.dimen.spacer_1x), 0, 0); params.setFlexBasisPercent(.15f); TypedArray a = context.obtainStyledAttributes(attrs, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/OverlappingAvatars.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/OverlappingAvatars.java index 3bf445980..0facc385c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/OverlappingAvatars.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/OverlappingAvatars.java @@ -18,12 +18,11 @@ import com.bumptech.glide.request.RequestOptions; import java.util.List; +import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.User; -import static it.niedermann.android.util.DimensionUtil.dpToPx; - public class OverlappingAvatars extends RelativeLayout { final int maxAvatarCount; @Px @@ -45,9 +44,9 @@ public class OverlappingAvatars extends RelativeLayout { public OverlappingAvatars(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); maxAvatarCount = context.getResources().getInteger(R.integer.max_avatar_count); - avatarBorderSize = dpToPx(context, R.dimen.avatar_size_small_overlapping_border); - avatarSize = dpToPx(context, R.dimen.avatar_size_small) + avatarBorderSize * 2; - overlapPx = dpToPx(context, R.dimen.avatar_size_small_overlapping); + avatarBorderSize = DimensionUtil.INSTANCE.dpToPx(context, R.dimen.avatar_size_small_overlapping_border); + avatarSize = DimensionUtil.INSTANCE.dpToPx(context, R.dimen.avatar_size_small) + avatarBorderSize * 2; + overlapPx = DimensionUtil.INSTANCE.dpToPx(context, R.dimen.avatar_size_small_overlapping); borderDrawable = ContextCompat.getDrawable(context, R.drawable.avatar_border); assert borderDrawable != null; DrawableCompat.setTint(borderDrawable, ContextCompat.getColor(context, R.color.bg_card)); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labelchip/CompactLabelChip.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labelchip/CompactLabelChip.java index 91b0f17ac..a2a50430c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labelchip/CompactLabelChip.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labelchip/CompactLabelChip.java @@ -6,17 +6,16 @@ import android.content.Context; import androidx.annotation.NonNull; import androidx.annotation.Px; +import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Label; -import static it.niedermann.android.util.DimensionUtil.dpToPx; - @SuppressLint("ViewConstructor") public class CompactLabelChip extends LabelChip { public CompactLabelChip(@NonNull Context context, @NonNull Label label, @Px int gutter) { super(context, label, gutter); params.setFlexBasisPercent(1 / 6.5f); - setHeight(dpToPx(context, R.dimen.compact_label_height)); + setHeight(DimensionUtil.INSTANCE.dpToPx(context, R.dimen.compact_label_height)); } }
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labellayout/LabelLayout.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labellayout/LabelLayout.java index 77e916aaf..3db539e53 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labellayout/LabelLayout.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/view/labellayout/LabelLayout.java @@ -11,13 +11,12 @@ import com.google.android.flexbox.FlexboxLayout; import java.util.LinkedList; import java.util.List; +import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.ui.view.labelchip.LabelChip; -import static it.niedermann.android.util.DimensionUtil.dpToPx; - public abstract class LabelLayout extends FlexboxLayout { @Px @@ -27,7 +26,7 @@ public abstract class LabelLayout extends FlexboxLayout { public LabelLayout(Context context, AttributeSet attrs) { super(context, attrs); - this.gutter = dpToPx(context, R.dimen.spacer_1hx); + this.gutter = DimensionUtil.INSTANCE.dpToPx(context, R.dimen.spacer_1hx); } /** |