Ich zeige eine transparente Hintergrundaktivität oben auf meiner Android Hauptaktivität. Diese transparente Aktivität hat einige Animationen und markiert den Teil eines Hauptbildschirms mit 100% transparentem Farbhintergrund.Onboarding für neue Benutzer anzeigen
Auf diese Weise kann ich mehr über die Funktion für Neulinge informieren.
Die einzige Sache, die ich nicht weiß, ist, wie man den hervorgehobenen Teil ohne 20% schwarze Farbe zeigt.
Mein Android-Layout ist:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/backgroundView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_20">
<LinearLayout
android:id="@+id/contentView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<TextView
android:id="@+id/textViewSuccess"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="24dp"
android:background="@color/accent"
android:gravity="center_horizontal"
android:padding="20dp"
android:text="Use estimation cards for your user stories."
android:textColor="#ffff"
android:visibility="invisible" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Got it." />
</LinearLayout>
<ImageView
android:id="@+id/imageView"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_user_estimation"
android:visibility="visible" />
</RelativeLayout>
Eine Sache ist, Sie können das gleiche Layout in transparente Aktivität verwenden und nur diejenigen sichtbar machen, die Sie markieren und andere unsichtbar setzen möchten. –