1
Good afternoon I’m making an app for studies, and I’m encountering a small problem is not enough to be a bug, but come on, this is my home screen:
As it is in the print below, I have a relative layout that has 1 note with its edittext and weight with its edittext.
when I click on the + one that is an Imagebutton it enters the setonclicklistnner and visible arrow pro another relative layout that is just below...
In this part that is circled red is another element that is inside a relative layout that has its own id, in that x he arrow Invisible pro note 2, getting as it was in image two...
Now after explaining, my question is how do I make that blank part where is the other relative sum layout ? as if there was nothing there, and the result and the sum stay close to the note 1?
my layout code is this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="Nome da Matéria:"
android:textSize="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="Name"
android:ems="10"
android:id="@+id/editText2" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="Nota 1:"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:textAllCaps="false" />
<TextView
android:text="Peso"
android:layout_marginLeft="120dp"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text=""
android:ems="10"
android:id="@+id/editText3"
/>
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text=""
android:ems="10"
android:id="@+id/editText"
android:fontFamily="sans-serif"
android:layout_marginLeft="120dp"
/>
<ImageButton
android:layout_width="wrap_content"
android:background="#fff"
android:layout_marginLeft="220dp"
android:src="@drawable/plus_one"
android:id="@+id/more1"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:visibility="invisible"
android:id="@+id/lig1"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="Nota 2:"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="false" />
<TextView
android:text="Peso"
android:layout_marginLeft="120dp"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:visibility="invisible"
android:id="@+id/lig1.1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text=""
android:ems="10"
android:id="@+id/editText4"
/>
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text=""
android:ems="10"
android:id="@+id/editText5"
android:fontFamily="sans-serif"
android:layout_marginLeft="120dp"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/closerlig1"
android:background="#fff"
android:layout_marginLeft="220dp"
android:src="@drawable/close_box_outline"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4"
android:textSize="20sp" />
<Button
android:text="Somar"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/resultado"
android:textAllCaps="false" />
</RelativeLayout>
ata thanks I didn’t know, do . Gone the Visible and Invisible I knew vlw help!
– Steve Rogers
I’m glad I was able to help you before they locked the question...!
– Leonardo Dias