I know we can set the following values to the android:gravity and android:layout_gravity properties:
android:layout_gravity is the Outside gravity of the View. Specifies the direction in which the View should touch its parent's border.
android:gravity is the Inside gravity of that View. Specifies in which direction its contents should align.
Android | CSS
————————————————————————+————————————
android:layout_gravity | float
android:gravity | text-align
Take layout-gravity as "Lay-outside-gravity".