Skip to content

Commit

Permalink
Remove unused libraries, resources, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bramborman committed Aug 18, 2024
1 parent 8a866f6 commit 7ed8d69
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 107 deletions.
10 changes: 0 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ android {
targetSdk 34
versionCode 14
versionName "1.4.4-pre"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand Down Expand Up @@ -63,12 +62,3 @@ base {
"${android.defaultConfig.versionName}+${android.defaultConfig.versionCode}" +
".${System.env.BUILD_ID ?: "local"}"
}

dependencies {
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.NFCQuickSettingsTile"
tools:targetApi="31">

<activity
Expand Down
25 changes: 20 additions & 5 deletions app/src/main/java/au/id/colby/nfcquicksettings/NfcTileService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import android.content.IntentFilter
import android.content.pm.PackageManager
import android.content.pm.PackageManager.PERMISSION_GRANTED
import android.nfc.NfcAdapter
import android.os.Build
import android.os.Build.VERSION.SDK_INT
import android.os.Build.VERSION_CODES
import android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE
import android.provider.Settings
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import android.util.Log
import androidx.core.content.ContextCompat
import au.id.colby.nfcquicksettings.R.string

private const val TAG = "NfcTileService"
Expand Down Expand Up @@ -56,12 +56,10 @@ class NfcTileService : TileService() {
override fun onStartListening() {
super.onStartListening()
Log.d(TAG, "onStartListening; Registering broadcast receiver")
ContextCompat.registerReceiver( // No harm if already registered.
this,
registerReceiver( // No harm if already registered.
nfcBroadcastReceiver,
IntentFilter(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED),
ContextCompat.RECEIVER_EXPORTED
)
RECEIVER_EXPORTED)
updateTile()
}

Expand Down Expand Up @@ -180,6 +178,23 @@ class NfcTileService : TileService() {
)
}

/**
* Registers a broadcast [receiver] with the specified intent [filter] and, if supported, the [flags].
*
* Note [flags] will be ignored on Android earlier than T.
*
* @param receiver The broadcast receiver to register.
* @param filter The intent filter for the registered broadcast receiver.
* @param flags The flags used when registering the broadcast receiver.
*/
override fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?, flags: Int): Intent? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
super.registerReceiver(receiver, filter, flags)
else
@Suppress("UnspecifiedRegisterReceiverFlag")
super.registerReceiver(receiver, filter)
}

/**
* Updates the Quick Settings tile with the [newState] and (if supported) [newSubTitleResId].
*
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/values-night/themes.xml

This file was deleted.

10 changes: 0 additions & 10 deletions app/src/main/res/values/colors.xml

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/res/values/themes.xml

This file was deleted.

21 changes: 0 additions & 21 deletions app/src/test/java/au/id/colby/nfcquicksettings/ExampleUnitTest.kt

This file was deleted.

0 comments on commit 7ed8d69

Please sign in to comment.