Skip to content

Commit

Permalink
Added Screen dimmer
Browse files Browse the repository at this point in the history
  • Loading branch information
legendsayantan committed Sep 12, 2022
1 parent fec6de5 commit 146f45b
Show file tree
Hide file tree
Showing 19 changed files with 1,638 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
//noinspection GradleCompatible
implementation 'com.android.support:palette-v7:28.0.0'
implementation 'com.larswerkman:HoloColorPicker:1.5'
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
//Sleep api
implementation 'com.google.android.gms:play-services-location:20.0.0'

Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
31 changes: 29 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,30 @@
<uses-permission
android:name="android.permission.BIND_QUICK_SETTINGS_TILE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />

<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Screenery">
<activity
android:name=".FrameActivity"
android:exported="false" />

<receiver
android:name=".SleepReceiver"
android:enabled="true"
android:exported="true"/>
android:exported="true" />

<service
android:name=".WakeFloatingService"
android:enabled="true"
android:exported="true"/>
android:exported="true" />
<service
android:name=".DimFloatingService"
android:enabled="true"
android:exported="true" />
<service
android:name=".WakeTileService"
android:exported="true"
Expand All @@ -39,10 +49,27 @@
android:name="android.service.quicksettings.ACTIVE_TILE"
android:value="true" />
</service>
<service
android:name=".DimTileService"
android:exported="true"
android:icon="@drawable/ic_outline_mode_night_24"
android:label="@string/dimtile"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>

<meta-data
android:name="android.service.quicksettings.ACTIVE_TILE"
android:value="true" />
</service>

<activity
android:name=".WakeActivity"
android:exported="false" />
<activity
android:name=".DimActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

Expand Down Expand Up @@ -122,6 +123,7 @@ public static void initCard(MaterialCardView cardView){
});
});
}

@SuppressLint("ClickableViewAccessibility")
public static void initCardToggle(MaterialCardView cardView,Runnable onToggle){
activity.runOnUiThread(() -> {
Expand Down Expand Up @@ -157,6 +159,9 @@ public static int getSecondaryAccentColor(){
if (!nightUi)return lightColor;
else return darkColor;
}
public static int getMedianColour(){
return ColorUtils.blendARGB(lightColor,darkColor,0.5f);
}
public static void initContainer(View parent){
activity.runOnUiThread(() -> {
parent.animate().alpha(0);
Expand Down
Loading

0 comments on commit 146f45b

Please sign in to comment.