Q:

How to align items justified in android linear layout horizontal orientation?

I have 5 images which should be placed horizontally in a linear layout and should be in a justified manner with the 3rd image at the center of the screen. All the images are of same width and height.
ie the padding between the images should dynamically adjust.
Thanks

A:

You can use 
android:layout_weight="1"
for each of your items which will solve your problem and arrange the items using equal space in the screen

A:

Try this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff5678" />

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"/>

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff5678" />

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"/>

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff5678" />

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"/>

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff5678" />

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"/>

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff5678" />
</LinearLayout>

Beetwen each ImageView add empty View with params: android:layout_width="0dp"
android:layout_weight="1"

