mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-08 08:37:19 +02:00
Added findSnackbarLayout
This commit is contained in:
@@ -1036,6 +1036,20 @@ public class Helper {
|
||||
return context.getResources().getDimensionPixelSize(resid);
|
||||
}
|
||||
|
||||
static Snackbar.SnackbarLayout findSnackbarLayout(View rootView) {
|
||||
if (rootView instanceof Snackbar.SnackbarLayout)
|
||||
return (Snackbar.SnackbarLayout) rootView;
|
||||
|
||||
if (rootView instanceof ViewGroup) {
|
||||
for (int i = 0; i < ((ViewGroup) rootView).getChildCount(); i++)
|
||||
if (findSnackbarLayout(((ViewGroup) rootView).getChildAt(i)) != null)
|
||||
return findSnackbarLayout(((ViewGroup) rootView).getChildAt(i));
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static @NonNull List<View> getViewsWithTag(@NonNull View view, @NonNull String tag) {
|
||||
List<View> result = new ArrayList<>();
|
||||
if (view != null && tag.equals(view.getTag()))
|
||||
|
||||
Reference in New Issue
Block a user