Отключить «Имя приложения» в деятельности, работающей в качестве диалога - PullRequest
0 голосов
/ 06 ноября 2019

Я сделал активность как диалог. Его задача - показать подсказку о биометрической аутентификации. Проблема в том, что каждый раз отображается «AppName» (WSZIBMobile). Его экран screen_with_showed_dialog

Я создал собственный стиль в styles.xml и пытаюсь скрыть это имя в функции onCreate с помощью

    requestWindowFeature(Window.FEATURE_NO_TITLE)
    actionBar?.hide()

styles.xml

<style name="mytheme" parent="Theme.AppCompat.Light.Dialog">
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowNoTitle">true</item>
    <item name = "android:windowContentOverlay" >@null</item >
    <item name = "android:colorBackgroundCacheHint" >@null</item >
    <item name = "android:gravity" >bottom</item >
    <item name = "android:backgroundDimEnabled">true</item>
    <item name="android:windowFrame">@null</item>
</style>

SmallBiometric.xml

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:excludeFromRecents="true"
android:foregroundGravity="bottom"
tools:context=".Fragments.SmallBiometricAuth">


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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:background="@drawable/rounded_corners"
        android:foregroundGravity="bottom"
        android:gravity="bottom"
        android:orientation="vertical"
        android:paddingTop="15dp">

        <ImageView
            android:id="@+id/finger_print_icon"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:layout_gravity="center"
            android:background="#ffffff"
            android:src="@drawable/ic_fingerprint_black" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp"
            android:text="Zidentyfikuj się"
            android:textAlignment="center"
            android:textColor="#111111"
            android:textSize="15sp" />

        <TextView
            android:id="@+id/cancel_auth"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            android:text="Anuluj"
            android:textAlignment="center"
            android:textColor="#0055A5"
            android:textSize="22sp"
            android:textStyle="bold" />
    </LinearLayout>
</LinearLayout>

androidManifest.xml

<activity android:name=".Fragments.SmallBiometricAuth" android:theme="@style/mytheme" />

Оба не работают. Пожалуйста, помогите;)

@ EDIT

Большое спасибо @Sanket Bhat Удалить справку по пространству имен "android"

1 Ответ

0 голосов
/ 07 ноября 2019

Я заметил, что вы используете Theme.AppCompat.Light.Dialog, поэтому, пожалуйста, удалите android: пространство имен из вашей темы.

<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

Причина: android: пространство имен используется для атрибута, поступающего из Android SDK, и, поскольку AppCompat является вспомогательной библиотекой, вы можете использовать app: пространство имен или объявить его без пространства имен

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...