markushi/android-ui

ActionView doesn't center when width and height are changed during orientation change

ssppgit opened this issue · 1 comments

Hi!

I have using ActionView in my layout. I have define width and height in dimens.xml for landscape and portrait.

<at.markushi.ui.ActionView
        android:id="@+id/action"
        android:layout_width="@dimen/action_size"
        android:layout_height="@dimen/action_size"
        android:padding="16dp"
        android:background="#FF0000"
        app:av_action="drawer"
        app:av_color="@android:color/white"/>

action_size is 56dp for portrait and 48dp for landscape.

When i run my app i see well the ActionView. However if i change orientation of my device, Image of actionView doesn't center well. I don't know why because if a run my app only in landscape mode i see well the actionView.

You can see it in this image.

action

Any idea? Thanks!

i use this and it's work fine:

<LinearLayout
            android:id="@+id/menu_monitor"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:gravity="center"
            android:orientation="vertical" >

            <at.markushi.ui.ActionView
                android:id="@+id/action"
                android:layout_width="56dp"
                android:layout_height="56dp"
                android:padding="16dip" />

</LinearLayout>