-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Tasker event trigger when wallpaper changes
- Loading branch information
1 parent
1c7ae97
commit aa3ce3b
Showing
5 changed files
with
41 additions
and
1 deletion.
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
27 changes: 27 additions & 0 deletions
27
...ain/java/com/anthonyla/paperize/feature/wallpaper/tasker_shortcut/WallpaperChangeEvent.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,27 @@ | ||
package com.anthonyla.paperize.feature.wallpaper.tasker_shortcut | ||
|
||
import android.app.Activity | ||
import android.content.Context | ||
import android.os.Bundle | ||
import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfig | ||
import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfigHelperEventNoOutputOrInputOrUpdate | ||
import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfigNoInput | ||
import com.joaomgcd.taskerpluginlibrary.extensions.requestQuery | ||
import com.joaomgcd.taskerpluginlibrary.input.TaskerInput | ||
|
||
class BasicEventHelper(config: TaskerPluginConfig<Unit>) : TaskerPluginConfigHelperEventNoOutputOrInputOrUpdate(config) { | ||
override fun addToStringBlurb(input: TaskerInput<Unit>, blurbBuilder: StringBuilder) { | ||
blurbBuilder.append("Triggers when the app changes the wallpaper") | ||
} | ||
} | ||
|
||
class ActivityConfigBasicEvent : Activity(), TaskerPluginConfigNoInput { | ||
override val context: Context get() = applicationContext | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
BasicEventHelper(this).finishForTasker() | ||
} | ||
} | ||
|
||
fun Context.triggerWallpaperTaskerEvent() = ActivityConfigBasicEvent::class.java.requestQuery(this) | ||
|
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