Skip to content

Commit a6d7bd7

Browse files
committed
move files across computers
1 parent 938278b commit a6d7bd7

File tree

17 files changed

+626
-288
lines changed

17 files changed

+626
-288
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ To develop for the Android App, Android Studio is the preferred IDE. And you can
2525

2626
#### Create a new issue
2727

28-
If you find a bug or want to suggest a feature, check if an issue already exists by searching through our [existing issues](https://github.com/username/AirPods-Like-Normal/issues). If no relevant issue exists, open a new one and fill in the details.
28+
If you find a bug or want to suggest a feature, check if an issue already exists by searching through our [existing issues](https://github.com/kavishdevar/aln/issues). If no relevant issue exists, open a new one and fill in the details.
2929

3030
#### Solve an issue
3131

32-
Browse our [issues list](https://github.com/username/AirPods-Like-Normal/issues) to find an interesting issue to work on. Use labels to filter issues and pick one that matches your expertise. If you’d like to work on an issue, open a PR with your solution.
32+
Browse our [issues list](https://github.com/kavishdevar/aln/issues) to find an interesting issue to work on. Use labels to filter issues and pick one that matches your expertise. If you’d like to work on an issue, open a PR with your solution.
3333

3434
### Make Changes
3535

3636
#### Make changes locally
3737

3838
1. Fork the repository and clone it to your local environment.
3939
```
40-
git clone https://github.com/your-username/AirPods-Like-Normal.git
40+
git clone https://github.com/kavishdevar/aln.git
4141
cd AirPods-Like-Normal
4242
```
4343
2. Create a working branch to start your changes.
@@ -67,4 +67,4 @@ Once your PR is open, a team member will review it. They may ask questions or re
6767

6868
### Your PR is merged!
6969

70-
Congratulations! :tada: Once merged, your contributions will be publicly available in AirPodsLikeNormal.
70+
Congratulations! :tada: Once merged, your contributions will be publicly available in AirPodsLikeNormal.

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
1919
android:usesPermissionFlags="neverForLocation"
2020
tools:ignore="UnusedAttribute" />
21+
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
2122
<application
2223
android:allowBackup="true"
2324
android:dataExtractionRules="@xml/data_extraction_rules"

android/app/src/main/java/me/kavishdevar/aln/MainActivity.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ fun Main() {
146146
isRemotelyConnected.value = CrossDevice.isAvailable
147147
isConnected.value = false
148148
}
149+
else if (intent.action == AirPodsNotifications.DISCONNECT_RECEIVERS) {
150+
Log.d("MainActivity", "Disconnect Receivers intent received")
151+
try {
152+
context.unregisterReceiver(this)
153+
}
154+
catch (e: Exception) {
155+
Log.e("MainActivity", "Error while unregistering receiver: $e")
156+
}
157+
}
149158
}
150159
}
151160

@@ -159,10 +168,12 @@ fun Main() {
159168
sharedPreferences.registerOnSharedPreferenceChangeListener(isAvailableChangeListener)
160169
Log.d("MainActivity", "CrossDeviceIsAvailable: ${sharedPreferences.getBoolean("CrossDeviceIsAvailable", false)} | isAvailable: ${CrossDevice.isAvailable}")
161170
isRemotelyConnected.value = sharedPreferences.getBoolean("CrossDeviceIsAvailable", false) || CrossDevice.isAvailable
171+
Log.d("MainActivity", "isRemotelyConnected: ${isRemotelyConnected.value}")
162172
val filter = IntentFilter().apply {
163173
addAction(AirPodsNotifications.AIRPODS_CONNECTED)
164174
addAction(AirPodsNotifications.AIRPODS_DISCONNECTED)
165175
addAction(AirPodsNotifications.AIRPODS_CONNECTION_DETECTED)
176+
addAction(AirPodsNotifications.DISCONNECT_RECEIVERS)
166177
}
167178
Log.d("MainActivity", "Registering Receiver")
168179

android/app/src/main/java/me/kavishdevar/aln/composables/AccessibilitySettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fun DropdownMenuComponent(
148148
Column (
149149
modifier = Modifier
150150
.fillMaxWidth()
151-
.padding(horizontal = 8.dp)
151+
.padding(horizontal = 12.dp)
152152
) {
153153
Text(
154154
text = label,

android/app/src/main/java/me/kavishdevar/aln/composables/AdaptiveStrengthSlider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ fun AdaptiveStrengthSlider(service: AirPodsService, sharedPreferences: SharedPre
8282
value = sliderValue.floatValue,
8383
onValueChange = {
8484
sliderValue.floatValue = it
85-
service.setAdaptiveStrength(100 - it.toInt())
8685
},
8786
valueRange = 0f..100f,
8887
onValueChangeFinished = {
8988
sliderValue.floatValue = sliderValue.floatValue.roundToInt().toFloat()
89+
service.setAdaptiveStrength(100 - sliderValue.floatValue.toInt())
9090
},
9191
modifier = Modifier
9292
.fillMaxWidth()

android/app/src/main/java/me/kavishdevar/aln/composables/NoiseControlButton.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818

1919
package me.kavishdevar.aln.composables
2020

21-
import androidx.compose.foundation.background
2221
import androidx.compose.foundation.clickable
2322
import androidx.compose.foundation.interaction.MutableInteractionSource
2423
import androidx.compose.foundation.layout.Arrangement
2524
import androidx.compose.foundation.layout.Column
2625
import androidx.compose.foundation.layout.fillMaxHeight
2726
import androidx.compose.foundation.layout.padding
2827
import androidx.compose.foundation.layout.size
29-
import androidx.compose.foundation.shape.RoundedCornerShape
3028
import androidx.compose.material3.Icon
3129
import androidx.compose.runtime.Composable
3230
import androidx.compose.runtime.remember
@@ -44,18 +42,18 @@ fun NoiseControlButton(
4442
icon: ImageBitmap,
4543
onClick: () -> Unit,
4644
textColor: Color,
47-
backgroundColor: Color,
48-
modifier: Modifier = Modifier
45+
modifier: Modifier = Modifier,
46+
usePadding: Boolean = true
4947
) {
5048
Column(
5149
modifier = modifier
5250
.fillMaxHeight()
53-
.padding(horizontal = 4.dp, vertical = 4.dp)
54-
.background(color = backgroundColor, shape = RoundedCornerShape(11.dp))
51+
.then(if (usePadding) Modifier.padding(horizontal = 4.dp, vertical = 4.dp) else Modifier)
5552
.clickable(
5653
onClick = onClick,
5754
indication = null,
58-
interactionSource = remember { MutableInteractionSource() }),
55+
interactionSource = remember { MutableInteractionSource() }
56+
),
5957
horizontalAlignment = Alignment.CenterHorizontally,
6058
verticalArrangement = Arrangement.Center
6159
) {
@@ -75,6 +73,5 @@ fun NoiseControlButtonPreview() {
7573
icon = ImageBitmap.imageResource(R.drawable.noise_cancellation),
7674
onClick = {},
7775
textColor = Color.White,
78-
backgroundColor = Color.Black
7976
)
8077
}

0 commit comments

Comments
 (0)