In my widget I've an image of a refresh icon and circular progress bar (CPB) that is showed when the refresh icon is pressed (obviously only one view can be showed in the same time). The CPB is too big, so I try to set scaleX and scaleY to 0.7 and my CPB is smaller, but this had the side effect that there is empty space where there was a bigger CPB.
How do I set this 2 view in the same position with the same height and width?
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="right"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/navigation_refresh" />
<ProgressBar
android:id="@+id/progressBar1"
android:scaleX="0.7"
android:scaleY="0.7"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</FrameLayout>
I can remove the scale and force the frame layout width and height to 28dp for example, and in this way it works fine, but I'm not sure if this is the best practice to do. (For example in this way in a tablet with a big screen maybe the images will be a little big bigger because I'm using "dp", but not of the right size. Am I wrong?)