Image getting behind the background

Asked

Viewed 113 times

0

I would like to put an image in front of another image. I’ll explain it better. I have a background and want to put an image on the dividing line between Relativelayout and Scrollview.

On native android I have the option:

app:layout_anchorGravity="bottom|end"

That stays that way:

Collapsing

Suppose instead of that icon you put an image.

But look at mine:

inserir a descrição da imagem aqui

Follows the code:

<?xml version="1.0" encoding="utf-8"?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:diagonal="http://schemas.android.com/tools"
    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.github.florent37.diagonallayout.DiagonalLayout
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:elevation="10dp"
        android:fitsSystemWindows="true"
        app:diagonal_angle="20"
        diagonal:diagonal_direction="left"
        diagonal:diagonal_position="bottom">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop" />

        <com.flaviofaria.kenburnsview.KenBurnsView
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:elevation="10dp"
            android:src="@drawable/background_detalhes_clientes" />

    </com.github.florent37.diagonallayout.DiagonalLayout>

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/imageContact"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_marginLeft="40dp"
        android:layout_marginStart="40dp"
        android:layout_marginVertical="160dp"
        android:src="@drawable/cliente_cadastrado" />

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/imagemAlterar"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_marginHorizontal="50dp"
        android:layout_marginTop="180dp"
        android:focusable="true"
        android:src="@drawable/ic_pencil" />


    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="250dp"
        android:baselineAligned="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/activityDetalhesClientesTXTdetalheNome"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="60dp"
                android:layout_marginStart="60dp"
                android:layout_marginTop="60dp"
                android:drawableLeft="@drawable/ic_cad_cliente"
                android:drawablePadding="10dp"
                android:drawableStart="@drawable/ic_cad_cliente"
                android:ellipsize="end"
                android:hint="@string/nomeHintCadastrarCliente"
                android:paddingVertical="20dp"
                android:singleLine="true"
                android:textIsSelectable="true"
                android:textSize="20dp" />

            <TextView
                android:id="@+id/activityDetalhesClientesTXTdetalhesFone"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="60dp"
                android:layout_marginStart="60dp"
                android:drawableLeft="@drawable/ic_phone_cad_cliente"
                android:drawablePadding="20dp"
                android:drawableStart="@drawable/ic_phone_cad_cliente"
                android:ellipsize="end"
                android:hint="@string/nomeHintCadastrarCliente"
                android:paddingVertical="20dp"
                android:singleLine="true"
                android:textIsSelectable="true"
                android:textSize="20sp" />

            <TextView
                android:id="@+id/activityDetalhesClientesTXTdetalhesEmail"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="60dp"
                android:layout_marginStart="60dp"
                android:drawableLeft="@drawable/ic_mail_cad_cliente_24dp"
                android:drawablePadding="20dp"
                android:drawableStart="@drawable/ic_mail_cad_cliente_24dp"
                android:ellipsize="end"
                android:hint="@string/nomeHintCadastrarCliente"
                android:paddingVertical="20dp"
                android:singleLine="true"
                android:textIsSelectable="true"
                android:textSize="20sp" />

            <TextView
                android:id="@+id/activityDetalhesClientesTXTdetalhesRua"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="60dp"
                android:layout_marginStart="60dp"
                android:drawableLeft="@drawable/ic_endereco_cad_cliente"
                android:drawablePadding="20dp"
                android:drawableStart="@drawable/ic_endereco_cad_cliente"
                android:ellipsize="end"
                android:hint="@string/nomeHintCadastrarCliente"
                android:paddingVertical="20dp"
                android:singleLine="true"
                android:textIsSelectable="true"
                android:textSize="20sp" />

        </LinearLayout>
    </ScrollView>
</RelativeLayout>
  • Opa, which effect you want to have with Diagonallayout?

  • Hello @Digaopartner. Actually I don’t need the effect but put the image over the background. Thanks.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.