From 32ebf0e4f478a64cc580aa3da8fdf4f151c72545 Mon Sep 17 00:00:00 2001 From: Vologhat <47892605+Vologhat@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:08:52 +0300 Subject: [PATCH] added layout helper --- .../ru/vtosters/lite/utils/LayoutHelper.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/src/main/java/ru/vtosters/lite/utils/LayoutHelper.java diff --git a/app/src/main/java/ru/vtosters/lite/utils/LayoutHelper.java b/app/src/main/java/ru/vtosters/lite/utils/LayoutHelper.java new file mode 100644 index 000000000..7ca7a42fd --- /dev/null +++ b/app/src/main/java/ru/vtosters/lite/utils/LayoutHelper.java @@ -0,0 +1,24 @@ +package ru.vtosters.lite.utils; + +import android.widget.FrameLayout; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; + +public class LayoutHelper { + + public static int MATCH_PARENT = -1; + public static int FILL_PARENT = -1; + public static int WRAP_CONTENT = -2; + + public static LinearLayout.LayoutParams createLinear(int w, int h) { + return new LinearLayout.LayoutParams(w, h); + } + + public static RelativeLayout.LayoutParams createRelative(int w, int h) { + return new RelativeLayout.LayoutParams(w, h); + } + + public static FrameLayout.LayoutParams createFrame(int w, int h) { + return new FrameLayout.LayoutParams(w, h); + } +} \ No newline at end of file