-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
109 additions
and
12 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
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
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
37 changes: 37 additions & 0 deletions
37
app/src/main/java/au/id/colby/nfcquicksettings/NfcTilePreferencesActivity.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,37 @@ | ||
package au.id.colby.nfcquicksettings | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.provider.Settings | ||
import android.util.Log | ||
|
||
private const val TAG = "NfcTilePrefsActivity" | ||
|
||
/** | ||
* A custom "preferences" activity for the NFC Quick Settings tile. | ||
* | ||
* The activity has no display, but simply starts the NFC Settings activity, then finishes. By | ||
* default, this activity is not enabled (ie via the AndroidManifest.xml) however, if the | ||
* `WRITE_SECURE_SETTINGS` permission has been granted, then the NfcTileService will enable this | ||
* activity. See NfcTileService::onCreate(). | ||
*/ | ||
class NfcTilePreferencesActivity : Activity() { | ||
|
||
/** | ||
* Called when this activity is being created. | ||
* | ||
* This override simply starts the NFC Settings activity, then finishes this activity. | ||
*/ | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
Log.d(TAG, "onCreate") | ||
Log.i(TAG, "Starting the ACTION_NFC_SETTINGS activity") | ||
startActivity( | ||
Intent(Settings.ACTION_NFC_SETTINGS).setFlags( | ||
Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | ||
) | ||
) | ||
finish() | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
- Added metadata for F-Droid | ||
- Redirected long-tap to NFC Settings, when granted WRITE_SECURE_SETTINGS permission |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id 'com.android.application' version '8.5.1' apply false | ||
id 'com.android.library' version '8.5.1' apply false | ||
id 'com.android.application' version '8.5.2' apply false | ||
id 'com.android.library' version '8.5.2' apply false | ||
id 'org.jetbrains.dokka' version '1.9.20' apply false | ||
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false | ||
id 'org.jetbrains.kotlin.android' version '2.0.10' apply false | ||
} |