Skip to content

Commit

Permalink
Merge pull request #132 from ColumbusUtrigas/master
Browse files Browse the repository at this point in the history
added quick settings launch button with icon
  • Loading branch information
udenr authored Aug 18, 2022
2 parents 53bd825 + 0aa9271 commit 622f8e7
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@
</intent-filter>
</service>

<service
android:name=".QuickTileService"
android:icon="@drawable/ic_tile"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">

<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>

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


<provider
android:name="androidx.core.content.FileProvider"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.secuso.privacyfriendlycodescanner.qrscanner

import android.content.Intent
import android.os.Build
import android.service.quicksettings.TileService
import androidx.annotation.RequiresApi
import com.secuso.privacyfriendlycodescanner.qrscanner.ui.activities.ScannerActivity

@RequiresApi(Build.VERSION_CODES.N)
class QuickTileService : TileService() {
override fun onClick() {
super.onClick()

val intent = Intent(this, ScannerActivity::class.java)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)

startActivityAndCollapse(intent)
}
}
109 changes: 109 additions & 0 deletions app/src/main/res/drawable/ic_tile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M0,0h512v512h-512z"
android:fillColor="#00000000"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M68.577,449.74h169.261V280.479H68.577V449.74zM219.031,430.934H87.384V299.287h131.647V430.934z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M106.191,318.094h94.033v94.033h-94.033z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M68.577,242.866h169.261V73.605H68.577V242.866zM219.031,224.06H87.384V92.413h131.647V224.06z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M106.191,111.219h94.033v94.034h-94.033z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M275.451,449.74h169.261V280.479H275.451V449.74zM425.905,430.934H294.258V299.287h131.647V430.934z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M313.065,318.094h94.033v94.033h-94.033z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M275.451,205.252h37.613v37.614h-37.613z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M275.451,167.639h18.807v18.807h-18.807z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M294.258,148.832h37.613v18.807h-37.613z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M331.871,92.412l0,-18.807l-18.807,0l-18.806,0l-18.807,0l0,18.807l18.807,0l0,37.614l18.806,0l18.807,0l0,-18.807l-18.807,0l0,-18.807z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M369.484,224.059h75.228v18.807h-75.228z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M369.484,186.446l0,-18.807l-18.805,0l0,18.807l-18.808,0l0,56.42l18.808,0l0,-37.613l37.613,0l0,-18.807z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M275.451,130.026h18.807v18.807h-18.807z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M425.905,148.833l-18.807,0l0,18.807l-18.806,0l0,18.805l18.806,0l18.807,0l0,18.807l18.807,0l0,-56.419z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M425.905,73.605l-18.807,0l0,18.808l18.807,0l0,37.612l18.807,0l0,-56.42z"
android:fillColor="#FFFFFF"/>
</group>
<group>
<clip-path android:pathData="M0,0h512v512h-512z M 0,0"/>
<path
android:pathData="M388.292,92.412V73.605h-18.808v18.807h-18.806v37.614h-18.808v18.807h18.808h56.419V92.412H388.292zM388.292,130.026h-18.808v-18.807h18.808V130.026z"
android:fillColor="#FFFFFF"/>
</group>
</vector>

0 comments on commit 622f8e7

Please sign in to comment.