Separate text only message layouts.

This commit is contained in:
Alan Evans
2020-06-06 11:29:05 -03:00
committed by Greyson Parrelli
parent bb97407cde
commit 718471917f
11 changed files with 403 additions and 101 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.DimenRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -35,7 +36,7 @@ public class ThemeUtil {
return false;
}
public static int getThemedColor(@NonNull Context context, @AttrRes int attr) {
public static @ColorInt int getThemedColor(@NonNull Context context, @AttrRes int attr) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();

View File

@@ -181,6 +181,12 @@ public final class ViewUtil {
view.requestLayout();
}
public static void updateLayoutParamsIfNonNull(@Nullable View view, int width, int height) {
if (view != null) {
updateLayoutParams(view, width, height);
}
}
public static int getLeftMargin(@NonNull View view) {
if (ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_LTR) {
return ((ViewGroup.MarginLayoutParams) view.getLayoutParams()).leftMargin;