Skip to content

Commit

Permalink
Ready
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyJAIZ committed Oct 16, 2024
1 parent b67ae16 commit 0799abb
Show file tree
Hide file tree
Showing 37 changed files with 242 additions and 485 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build debug version of NST with Gradle
run: ./gradlew :app:assembleDebug
- name: Upload a Build Artifact
- name: Build debug version of TS with Gradle
run: ./gradlew :app:assembleGuiDebug :app:assembleBareDebug
- name: Upload a GUI Build Artifact
uses: actions/upload-artifact@v4
with:
name: NST-debugBuild
path: ./app/build/outputs/apk/debug/NST-debug.apk
name: TS-gui-debugBuild
path: ./app/build/outputs/apk/gui/debug/TS-gui-debug.apk
- name: Upload a Bare Build Artifact
uses: actions/upload-artifact@v4
with:
name: TS-bare-debugBuild
path: ./app/build/outputs/apk/bare/debug/TS-bare-debug.apk
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Notification Shade Transparency
# Translucent Shade
### Previously known as "Notification Shade Transparency"

**Compatible with Android 12+**
**Compatible with Android 12+, AOSP-based only, GUI application available**

![Dark theme preview](notifshade15d.png "Screenshot of the module working on Android 15, dark theme")![Light theme preview](notifshade15l.png "Screenshot of the module working on Android 15, light theme")
![Dark theme preview on Android 15](notifshade15d.png)![Light theme preview on Android 15](notifshade15l.png)

## To-Do
- [x] GUI
- [x] QS tiles part
- [ ] Tint coloring

## Older systems preview
![Light theme preview on Android 13](notifshade13.png)![Preview on Android 12 without tint](notifshade.png "Preview on Android 12 without tint")

### License
This project is licensed under the Apache License, Version 2.0 (the "License"). See [LICENSE](LICENSE) for details.
33 changes: 25 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ plugins {
}

android {
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.asyjaiz.A12blur"
minSdk 31
targetSdk 35
versionCode 6
versionName "1.5G"
versionCode 7
versionName '2.0'

archivesBaseName = "NST"
base.archivesName = "TS"
}

buildTypes {
Expand All @@ -28,19 +28,36 @@ android {
buildFeatures {
buildConfig true
}
flavorDimensions += 'blur'
productFlavors {
gui {
dimension 'blur'
versionNameSuffix '-G'
}
bare {
dimension 'blur'
versionNameSuffix '-N'
}
}
}

dependencies {

implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.activity:activity:1.9.2'
guiImplementation 'com.google.android.material:material:1.12.0'
guiImplementation 'androidx.constraintlayout:constraintlayout:2.1.4'
guiImplementation 'androidx.appcompat:appcompat:1.7.0'
guiImplementation 'androidx.activity:activity:1.9.3'
compileOnly fileTree("libs") {include("*.jar")}

//implementation 'androidx.appcompat:appcompat:1.4.2'
//implementation 'com.google.android.material:material:1.6.1'
//testImplementation 'junit:junit:4.13.2'
//androidTestImplementation 'androidx.test.ext:junit:1.1.3'
//androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
23 changes: 23 additions & 0 deletions app/src/gui/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".App">

<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Material3.DayNight.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<meta-data
tools:replace="android:value"
android:name="xposeddescription"
android:value="Lets you set up the translucency of your shade the way you want it to be" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
Expand All @@ -28,8 +30,6 @@ protected void onCreate(Bundle savedInstanceState) {
return insets;
});

SharedPreferences prefs = getSharedPreferences("set", MODE_WORLD_READABLE);

ImageView shade = findViewById(R.id.shade);
LayerDrawable drawable = (LayerDrawable) shade.getDrawable();
GradientDrawable behindScr = (GradientDrawable) drawable.findDrawableByLayerId(R.id.behindScrim);
Expand All @@ -38,6 +38,20 @@ protected void onCreate(Bundle savedInstanceState) {
Slider behindAlpha = findViewById(R.id.behind);
Slider notifAlpha = findViewById(R.id.notif);
MaterialSwitch auto = findViewById(R.id.auto);
TextView probs = findViewById(R.id.problem);

try {
getPreferences(MODE_WORLD_READABLE);
} catch (SecurityException e) {
probs.setVisibility(View.VISIBLE);
behindAlpha.setActivated(false);
notifAlpha.setActivated(false);
auto.setActivated(false);
return;
}

SharedPreferences prefs = getSharedPreferences("set", MODE_WORLD_READABLE);

behindAlpha.setValue(prefs.getFloat(behindAlpha.getTag().toString(), 1f));
notifAlpha.setValue(prefs.getFloat(notifAlpha.getTag().toString(), 1f));
auto.setChecked(prefs.getBoolean("auto", true));
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions app/src/gui/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/system_accent1_600"
android:pathData="M0,0h108v108h-108z"/>
</vector>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/settings"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appBarLayout"
app:srcCompat="@drawable/shade" />
Expand Down Expand Up @@ -73,17 +74,29 @@

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/auto"
android:layout_width="0dp"
android:layout_width="225dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:checked="true"
android:layoutDirection="rtl"
android:text="Auto"
android:text="@string/auto"
app:layout_constraintStart_toEndOf="@+id/shade"
app:layout_constraintTop_toTopOf="@+id/shade" />

<TextView
android:id="@+id/problem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:gravity="center_horizontal"
android:text="@string/problem"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/shade"
app:layout_constraintTop_toBottomOf="@+id/behind" />
app:layout_constraintTop_toBottomOf="@+id/auto" />


</androidx.constraintlayout.widget.ConstraintLayout>
104 changes: 104 additions & 0 deletions app/src/gui/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutMediumStyle"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize">

<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:elevation="0dp"
app:title="@string/settings" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<ImageView
android:id="@+id/shade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/settings"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appBarLayout"
app:srcCompat="@drawable/shade" />

<com.google.android.material.slider.Slider
android:id="@+id/behind"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="@+id/shade"
app:layout_constraintStart_toStartOf="@+id/shade"
app:layout_constraintTop_toTopOf="@+id/shade"
android:valueFrom="0.0"
android:valueTo="1.0"
android:value="1.0"
app:labelBehavior="floating"
app:thumbHeight="32dp"
android:tag="behind_alpha">

</com.google.android.material.slider.Slider>

<com.google.android.material.slider.Slider
android:id="@+id/notif"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="@+id/shade"
app:layout_constraintEnd_toEndOf="@+id/shade"
app:layout_constraintStart_toStartOf="@+id/shade"
app:layout_constraintTop_toBottomOf="@+id/behind"
android:valueFrom="0.0"
android:valueTo="1.0"
android:value="1.0"
android:tag="notif_alpha"/>

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/auto"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:checked="true"
android:layoutDirection="rtl"
android:text="@string/auto"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/shade"
app:layout_constraintTop_toTopOf="@+id/shade" />

<TextView
android:id="@+id/problem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:gravity="center_horizontal"
android:text="@string/problem"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/shade" />


</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 6 additions & 0 deletions app/src/gui/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="settings">Shade Settings</string>
<string name="auto">Auto</string>
<string name="problem">"It looks like the module was not instantiated properly.\nTry manually ticking SystemUI in LSPosed and reboot.\nIf it still doesn't work, there may be a problem with LSPosed.\nLimited functionality available"</string>
</resources>
File renamed without changes.
16 changes: 3 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@

<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".App">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Material3.DayNight.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
android:label="@string/app_name">

<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="Makes Notification Shade scrims transparent like in Android 11" />
android:value="Makes Notification Shade scrims translucent like in Android 11" />
<meta-data
android:name="xposedminversion"
android:value="94" />
android:value="93" />
<meta-data
android:name="xposedscope"
android:value="com.android.systemui" />
Expand Down
Loading

0 comments on commit 0799abb

Please sign in to comment.