AutoWear Notification Custom Screens Command on Hide

Discussion in 'AutoApps' started by Jonatan, Mar 4, 2015.

  1. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    So I just tried to recreate this:
    But I wanted to make it a little more fancy and have the main Notification be the last Music App I've opened through the Custom Screen on the Notification.
    I first tried updating the Notification every time I press on one of my 3 Media Apps but then it closed the Custom Screen because it updated the Notification so I tried using the "Command on Hide" on the Custom Screen hoping it would trigger when I swipe away from the screen. Turn out it isn't the case. Here my Notification/Custom Screen:
    Profile: Headset (36)
    State: Headset Plugged [ Type:Any ]
    Enter: Music Notification (43)
    A1: AutoWear Notification [ Configuration:persistent: true
    Title: Music
    Text: Play %LastMusicSource?
    Icon: /storage/emulated/0/Icons/%LastMusicSource.webp
    Hide Hint Icon: true
    Status Bar Icon: av_play
    Priority: 1
    Content Icon: true
    Button 1: %LastMusicSource
    Icon 1: av_play
    Show Now: true
    Trigger Event: true
    Haptic Feedback: true
    Name: Music

    ----Screens----

    Buttons Screen: Align: Center; Column Count: 2; Button Size: 135; Button Margin: 10; Commands: Spotify,Poweramp,TuneIn; Icons: /storage/emulated/0/Icons/Spotify.webp,/storage/emulated/0/Icons/Poweramp.webp,/storage/emulated/0/Icons/TuneIn.webp; Screen Mode: Turn on; Animation: Slide from right; Command Prefix: Music; Command on close: MusicHidden; Show Now: true; Trigger Event: true; Haptic Feedback: true; Command to show: &APPOPENED&; Name: Music
    ---------------
    Package:com.joaomgcd.autowear Name:AutoWear Notification Timeout (Seconds):20 ]
    Is this a bug or does "Command on Hide" just not work on Custom Screens attached to Notifications or am I just doing something wrong?
    Help would very much be appreciated :)

    EDIT: Ok, I now totally reworked the Task after I saw that there is a Step by Step guide in the description (derp :D) But still wondering if "Command on Hide" is possible on Custom Screens attached to Notifications
     
    Last edited: Mar 4, 2015
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    The command on hide does not work on embedded screens, no :) I'll see what I can do about it!
     
  3. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    Ok nice. I have another problem now with the Music Notification. I did everything exactly like in the Tutorial except the Launch app and press Play part. I have 2 apps marked with AutoWear music. That's Spotify and Poweramp. When my last used app is Poweramp everything works fine and when I swipe to the Custom Screen it shows both of the apps but when my last used app is Spotify it only shows Poweramp on the Custom Screen.
    Why could that be?
    Here is my new Task:

    Profile: Music Notification (21)
    State: Headset Plugged [ Type:Any ]
    Enter: Anon (32)
    A1: Variable Set [ Name:%LASTPLAYED To:Spotify Do Maths:Off Append:Off ] If [ %LASTPLAYED !Set ]
    A2: AutoLaunch Query [ Configuration:App Nickname: %LASTPLAYED
    Contains All App Nickname: true Package:com.joaomgcd.autoapps Name:AutoLaunch Query Timeout (Seconds):60 ]
    A3: Variable Set [ Name:%icon To:%alicons1 Do Maths:Off Append:Off ]
    A4: AutoLaunch Query [ Configuration:App Nickname: AutoWear music
    Contains All App Nickname: true Package:com.joaomgcd.autoapps Name:AutoLaunch Query Timeout (Seconds):60 ]
    A5: Flash [ Text:%alicons()
    %allabels() Long:Off ]
    A6: AutoWear Notification [ Configuration:Title: Music
    Text: Play %LASTPLAYED?
    Icon: %icon
    Hide Hint Icon: true
    Priority: 1
    Content Icon: true
    Button 1: play=:=%LASTPLAYED
    Icon 1: av_play
    Show Now: true
    Vibration Pattern: 0,133,214,143
    Trigger Event: true
    Haptic Feedback: true
    Name: Music

    ----Screens----

    Buttons Screen: Column Count: 5; Button Size: 90; Commands: %allabels() ; Icons: %alicons() ; Screen Mode: Turn on; Animation: Slide from right; Command Prefix: play; Show Now: true; Trigger Event: true; Haptic Feedback: true; Command to show: &APPOPENED&; Name: Music
    ---------------
    Package:com.joaomgcd.autowear Name:AutoWear Notification Timeout (Seconds):20 ]

    Exit: Anon (52)
    A1: AutoWear App [ Configuration:Execute Now: true
    Trigger Event: true
    Haptic Feedback: true
    Name: App
    AutoWear Elements: Delete
    AutoWear Element Id: Music Package:com.joaomgcd.autowear Name:AutoWear App Timeout (Seconds):60 ]
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    What does the flash in A5 of the first task show when only one app shows up?
     
  5. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    This is what it shows when Spotify is missing in the list:

    /storage/emulated/0/Android/data/com.joaomgcd.autoapps/files/com.maxmpz.audioplayer_2130837545,/storage/emulated/0/Android/data/com.joaomgcd.autoapps/files/com.spotify.music_2130837915
    Poweramp,Spotify

    And this when both are showing:

    /storage/emulated/0/Android/data/com.joaomgcd.autoapps/files/com.maxmpz.audioplayer_2130837545,/storage/emulated/0/Android/data/com.joaomgcd.autoapps/files/com.spotify.music_2130837915,/storage/emulated/0/Android/data/com.joaomgcd.autoapps/files/com.maxmpz.audioplayer.unlock_2130837504
    Poweramp,Spotify,Poweramp Full Version Unlocker

    I just noticed that it recognizes my Poweramp Ublocker in the second example. I don't know why it would find that app because it is not marked as AutoWear Music. And it seems like it is always just missing the last result from AutoLaunch in the Custom Screen.
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Maybe with a button size of 90 only 2 fit on the screen? Try setting column count to 2 :)
     
  7. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    I've set it to two and it didn't change anything. I'm also pretty sure space isn't an issue right here:
    uploadfromtaptalk1425656849627.png
    uploadfromtaptalk1425656902674.png
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hhmm, that's weird. What if you do it on a regular "AutoWear Buttons Screen" action instead of inside a notification?
     
  9. Jonatan

    Jonatan Member

    Joined:
    Feb 27, 2015
    Messages:
    59
    Likes Received:
    3
    Ok I fixed it now. Was like the stupidest mistake ever. First of SwiftKey put a space behind the %alicons and %allabels in the Custom Screen which made the last result not show and the issue where Poweramp Unlocker showed up was an easy fix as well. I just needed to clear the %alicons and %allabels array once after I set the %icon variable because otherwise it would include the Unlocker which it finds in the first Query. Working very well now. :)
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Great!
     

Share This Page