When we change brightness, its activity become transparent So We can see the home screen/ another app that running behind. I want (100% same like Brightness seekbar) on my custom seekbar.
My App main activity background color is gray,
I want when seekbar drag: My activity becomes transparent and show background activities/Background Home screen,
When drag completes its back to normal on gray background.
My Research:
I search on transparent activities, I found many questions and many different styles and theme options.
Here is my last try:
<activity android:name=".Activity"
android:theme="@android:style/Theme.Translucent">
Every time when I follow StackOverflow answers, I get this error:
"You need to use a Theme.AppCompat theme (or descendant) with this activity."
=>I also try, Transparent background color, Transparent drawable, transparent from manifest,
Result: Background show white, not transparent
I have just 1 main activity, with custom brightness seekbar and other options.
My Manifest file
<?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"
>