By what means is it better to create such a pop-up window?

enter image description here

Looked at lessons on AlertDialog , but I do not think that it approaches. What I see in the picture, apparently in the bottom line, is just some kind of animated Layout of fixed sizes, where you can shove anything. How to create such a window correctly?

1 answer 1

Well you what? Create your markup with your white square and everything your heart desires, call it, for example, alert.xml .

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="150dp" android:layout_height="150dp" android:backgroynd="#FAFAFA" android:elevation="5dp" android:gravity="center"> <TextView android:text="Hello, AlertDialog!" android:id="@+id/ad_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> 

Further

 AlertDialog.Builder adb = new AlertDialog.Builder(this); View my_custom_view = (LinearLayout) getLayoutInflater().inflate(R.layout.alert, null); //Π½Π°Ρ…ΠΎΠ΄ΠΈΠΌ Ρ€Π°Π·ΠΌΠ΅Ρ‚ΠΊΡƒ adb.setView(my_custom_view); //ставим Π΅Π΅ Π² ΠΎΠΊΠ½ΠΎ TextView ad_tv = (TextView)my_custom_view.findViewById(R.id.ad_tv); //Π½Π°Ρ…ΠΎΠ΄ΠΈΠΌ TextView ad_tv.setTextColor(Color.BLACK); AlertDialog ad = adb.create(); ad.show(); 

Edit

 Dialog d = new Dialog(this); View my_custom_view = getLayoutInflater().inflate(R.layout.alert, null); d.setContentView(my_custom_view); TextView ad_tv = (TextView)my_custom_view.findViewById(R.id.ad_tv); ad_tv.setTextColor(Color.BLACK); d.show();