I'm trying to make a custom popup, similar to the one in the photo, by putting a close button at the top and centering it in the middle of the screen, does anyone know how I do it? I searched for some codes, but nothing very complete
I'm trying to make a custom popup, similar to the one in the photo, by putting a close button at the top and centering it in the middle of the screen, does anyone know how I do it? I searched for some codes, but nothing very complete
With DialogFragment you get that way below
mButton.setOnclickListener(new OnclickListener(){
test();
});
public void test(){
Dialog dialog = new Dialog(this, R.style.FullHeightDialog);
dialog.setContentView(R.layout.seu_layout_customizado);
dialog.show();
}
Creating XML
<View android:layout_width="fill_parent" android:layout_height="1dp"/>
) to represent the line. To represent this grouping of icons and text (gps, wifi and wireless network) creates a RelativeLayout. For the confirmation button, add in the LinearLayout root.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="x"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Melhore..."/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Para garantir..."/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
gps
rede
wifi
</RelativeLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />