I have a RelativeLayout
displaying an app name with its icon below. I want to be able from the java side to switch icon and text positions, so the app name is displayed below the icon without having to inflate a new view. How can this be possible?
here is my code for that
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:paddingBottom="27dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/appIcon"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_margin="2dp"
android:layout_below="@+id/appName"
android:layout_centerHorizontal="true"
android:contentDescription="icon"
android:src="#80000000" />
<TextView
android:id="@+id/appName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:fontFamily="sans-serif-condensed"
android:gravity="center"
android:singleLine="true"
android:text="name"
android:textSize="13dp"/>
</RelativeLayout>