Skip to content

Android app improvements, multiple layouts problem #33

@pzmarzly

Description

@pzmarzly

In Android small improvements right now would be:

  • a reconnect button
  • correct IP should be based on zeroconf data (using IP from zeroconf and port received from Yoke instead of IP:port combo from Yoke) - another method to deal with multiple interfaces would be fine too. Then --iface option could be removed or modified (despite its name Yoke always binds on 0.0.0.0, the option sets which PC interface is accessible from app's point of view)
  • stop appending 3 floats to each message (that's like 54 bytes wasted per message. doesn't sound much but I can imagine some routers struggling) - corresponding code on Python side is marked for removal with TODO: comment
  • after reconnecting (or connecting do different machine), Yoke app keeps sending status from before the reconnect, until some layout is selected (so that update_vals is called)

Multiple layouts: navigation

Right now hitting Back makes the app quit. It could instead bring user back to layout selection screen. However, currently app makes it impossible to achieve on HTML/JS side alone.

Navigating with <a href="..."> causes browser selector to pop up:

Screenshot_20190713-203220

Meanwhile I made history.pushState-based system that in browser, but in app the back button event gets intercepted by app (HTML doesn't get any event)

Multiple layouts: management

Right now some settings are adjustable in base.js. Also, since layout is hardcoded in Python code, and some programs ignore SDL gamepad string, user may want to customize Python code. This is fine (I adjusted README to show this better), but a bit troublesome.

User may want VIBRATE_ON_PAD_BOUNDARY to be on on gamepad layout, but not on racing layout. If they ever create custom layouts, there would be even more problems. There are few solutions I can think of:

  1. Move these 2 new boolean settings to CSS - but that would make 3 options per joystick (locking? vibrating on quadrants? vibrating on edges?), which means 8 joystick types (+ number) instead of current 2 (locking or non-locking).
  2. Move all settings to JSON files. We could have it like [{type:'joystick',id:1,locking:true,vibrate_on_pad_boundary:false,x:100,y:300,background:'file.svg'},{type:'joystick',id:2, ...}]. Default options of course wouldn't need to be specified. It wouldn't have to be JSON, could be e.g. TOML. We would need either a good editor, or at least a reference (list of all widgets with their default options).
  3. Move back to single layout system and tell users to use Git branches for different configs. That would let them customize Python code. If they chose not do modify Python code, they could have hot-reloading with pip3 install -e . (symlinks instead of copying files). Versioned config files could be a plus, too. The downside is that Git is not newbie-friendly. We could make some helpers, e.g.
yoke new gamepad csgo -> git checkout gamepad && git checkout -b csgo # default gamepad preset would be a branch
yoke save -> git add ${YOKE_ROOT_DIR} && git commit -m $(date)
yoke list -> git branch
yoke history csgo -> git log --oneline csgo # branch is optional
yoke set csgo -> git checkout csgo
yoke rm csgo -> git branch -D csgo

In the third scenario, Multiple layouts: navigation part could turn out to be unnecessary.

@medape @rmst : your opinions are welcome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions