-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from thgoebel/design
Design & Material 3
- Loading branch information
Showing
13 changed files
with
104 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/de/simon/dankelmann/bluetoothlespam/ui/EdgeToEdgeUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.simon.dankelmann.bluetoothlespam.ui | ||
|
||
import android.view.View | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
import androidx.core.view.updatePadding | ||
|
||
|
||
fun setupEdgeToEdge(view: View, top: Boolean = true, bottom: Boolean = true) { | ||
ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets -> | ||
val i = insets.getInsets( | ||
WindowInsetsCompat.Type.systemBars() + WindowInsetsCompat.Type.displayCutout() | ||
) | ||
v.updatePadding( | ||
left = i.left, | ||
right = i.right, | ||
) | ||
if (top) { | ||
v.updatePadding(top = i.top) | ||
} | ||
if (bottom) { | ||
v.updatePadding(bottom = i.bottom) | ||
} | ||
WindowInsetsCompat.CONSUMED | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 30 additions & 66 deletions
96
app/src/main/res/layout/advertisement_foreground_service_notification.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="fill_parent" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:background="@color/background_color" | ||
> | ||
android:orientation="horizontal"> | ||
|
||
<ImageView | ||
android:id="@+id/advertisementForegroundServiceNotificationTargetImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:padding="10dp" | ||
android:src="@drawable/ic_android" | ||
app:tint="@color/tint_target_icon" | ||
/> | ||
|
||
app:tint="@color/tint_target_icon" /> | ||
|
||
<LinearLayout | ||
android:layout_width="0dp" | ||
android:layout_weight="1" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/advertisementForegroundServiceNotificationTitleTextView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="50" | ||
android:gravity="center" | ||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" | ||
android:textSize="18dp" | ||
android:ellipsize="end" | ||
android:gravity="center" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:textColor="@color/color_title"/> | ||
android:textColor="@color/color_title" | ||
android:textSize="18dp" | ||
tools:text="Title" /> | ||
|
||
<TextView | ||
android:id="@+id/advertisementForegroundServiceNotificationSubTitleTextView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="50" | ||
android:gravity="center" | ||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" | ||
android:textSize="15dp" | ||
android:ellipsize="marquee" | ||
android:textStyle="italic" | ||
android:gravity="center" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:textColor="@color/color_subtitle"/> | ||
android:textColor="@color/color_subtitle" | ||
android:textSize="15dp" | ||
android:textStyle="italic" | ||
tools:text="Subtitle" /> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="100dp" | ||
android:layout_height="match_parent" | ||
android:orientation="horizontal" | ||
android:layout_gravity="end" | ||
> | ||
|
||
<ImageView | ||
android:padding="10dp" | ||
android:id="@+id/advertisementForegroundServiceNotificationStopImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:src="@drawable/stop" | ||
app:tint="@color/tint_button_active" | ||
/> | ||
<ImageView | ||
android:padding="10dp" | ||
android:id="@+id/advertisementForegroundServiceNotificationToggleImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:src="@drawable/pause" | ||
app:tint="@color/tint_button_active" | ||
/> | ||
|
||
|
||
|
||
<!-- | ||
<ImageView | ||
android:padding="10dp" | ||
android:id="@+id/advertisementForegroundServiceNotificationPauseImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:src="@drawable/pause" | ||
app:tint="@color/tint_button_active" | ||
> | ||
</ImageView> | ||
<ImageView | ||
android:padding="10dp" | ||
android:id="@+id/advertisementForegroundServiceNotificationPlayImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:src="@drawable/play_arrow" | ||
app:tint="@color/tint_button_active"> | ||
</ImageView>--> | ||
<ImageView | ||
android:id="@+id/advertisementForegroundServiceNotificationStopImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:padding="10dp" | ||
android:src="@drawable/stop" | ||
app:tint="@color/tint_button_active" /> | ||
|
||
</LinearLayout> | ||
<ImageView | ||
android:id="@+id/advertisementForegroundServiceNotificationToggleImageView" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:padding="10dp" | ||
android:src="@drawable/pause" | ||
app:tint="@color/tint_button_active" /> | ||
|
||
</LinearLayout> | ||
</LinearLayout> |
45 changes: 20 additions & 25 deletions
45
app/src/main/res/layout/bluetooth_le_scan_foreground_service_notification.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="fill_parent" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationLayout" | ||
android:background="@color/background_color" | ||
> | ||
android:orientation="horizontal"> | ||
|
||
<ImageView | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationIcon" | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:padding="10dp" | ||
android:src="@drawable/bluetooth_searching" | ||
app:tint="@color/tint_target_icon" | ||
/> | ||
|
||
app:tint="@color/tint_target_icon" /> | ||
|
||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_weight="1" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationTitle" android:layout_width="wrap_content" | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationTitle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="50" | ||
android:gravity="center" | ||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" | ||
android:textSize="18dp" | ||
android:ellipsize="end" | ||
android:gravity="center" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:textColor="@color/color_title"/> | ||
android:textColor="@color/color_title" | ||
android:textSize="18dp" | ||
tools:text="Title" /> | ||
|
||
<TextView | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationSubTitle" android:layout_width="wrap_content" | ||
android:id="@+id/bluetoothLeScanningForegroundNotificationSubTitle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="50" | ||
android:gravity="center" | ||
android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" | ||
android:textSize="15dp" | ||
android:ellipsize="marquee" | ||
android:textStyle="italic" | ||
android:gravity="center" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:textColor="@color/color_subtitle"/> | ||
android:textColor="@color/color_subtitle" | ||
android:textSize="15dp" | ||
android:textStyle="italic" | ||
tools:text="Subtitle" /> | ||
</LinearLayout> | ||
|
||
|
||
|
||
</LinearLayout> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.