|
|
@ -56,12 +56,16 @@ object SystemUtils { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun isNavigationBarExist(activity: Activity?): Boolean { |
|
|
|
fun isNavigationBarExist(activity: Activity?): Boolean { |
|
|
|
activity?.let { |
|
|
|
activity?.let { |
|
|
|
val vp = it.window.decorView as? ViewGroup |
|
|
|
val viewGroup = it.window.decorView as? ViewGroup |
|
|
|
if (vp != null) { |
|
|
|
if (viewGroup != null) { |
|
|
|
for (i in 0 until vp.childCount) { |
|
|
|
for (i in 0 until viewGroup.childCount) { |
|
|
|
vp.getChildAt(i).context.packageName |
|
|
|
viewGroup.getChildAt(i).context.packageName |
|
|
|
if (vp.getChildAt(i).id != View.NO_ID |
|
|
|
if (viewGroup.getChildAt(i).id != View.NO_ID |
|
|
|
&& NAVIGATION == activity.resources.getResourceEntryName(vp.getChildAt(i).id) |
|
|
|
&& NAVIGATION == activity.resources.getResourceEntryName( |
|
|
|
|
|
|
|
viewGroup.getChildAt( |
|
|
|
|
|
|
|
i |
|
|
|
|
|
|
|
).id |
|
|
|
|
|
|
|
) |
|
|
|
) { |
|
|
|
) { |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|