Lorsque nous changeons la luminosité, son activité devient transparente Nous pouvons donc voir l'écran d'accueil/une autre application en cours d'exécution. Je veux (100% même comme Brightbar seekbar) sur ma barre de recherche personnalisée.Afficher l'activité transparente sur le changement de la barre de recherche
My App couleur principale de fond d'activité est gris,
Je veux quand seekbar glisser: Mon activité devient transparente et montrer les activités d'arrière-plan/arrière-plan écran d'accueil,
Lorsque déplacement se termine le dos à la normale sur fond gris.
Ma recherche:
Je recherche sur les activités transparentes, je l'ai trouvé beaucoup de questions et de styles différents et des options de thème.
Voici mon dernier essai:
<activity android:name=".Activity"
android:theme="@android:style/Theme.Translucent">
Chaque fois que je suis StackOverflow réponses, je reçois cette erreur:
"You need to use a Theme.AppCompat theme (or descendant) with this activity."
=> J'essaie aussi, la couleur d'arrière-plan transparent, transparent drawable, transparent du manifeste,
Résultat: Arrière-plan blanc, non transparent
J'ai seulement 1 activité principale, avec la barre de recherche personnalisée de luminosité et d'autres options.
Mon fichier Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="st.package">
<uses-permission
android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="st.package.ChatHeadService"
android:exported="true">
</service>
<receiver android:name="MainActivity$switchButtonListener" />
</application>
MainActivity.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="overlayhead.overlayhead.MainActivity"
android:orientation="vertical"
android:windowIsTranslucent="true"
android:id="@+id/LinearLayout"
android:background="@android:color/transparent"
>
voir ce lien et prendre une idée de ce que vous voulez. 1) [enlever l'arrière-plan de seekbar] (https://stackoverflow.com/questions/2459326/android-remove-seekbar-background) 2) [barre de recherche transparente] (https://stackoverflow.com/questions/26989400/custom -seekbar-thumb-not-transparent-on-lollipop-api21) –
voir ce lien et prendre une idée de ce que vous voulez. 1) [enlever l'arrière-plan de seekbar] (https://stackoverflow.com/questions/2459326/android-remove-seekbar-background) 2) [barre de recherche transparente] (https://stackoverflow.com/questions/26989400/custom -seekbar-thumb-not-transparent-on-lollipop-api21) –