Author: Mathias Lipowski

UX improvements: `enterkeyhint` to define action label for the keyboard of mobile devices

Usability

The enterkeyhint is a html attribute described in the HTML standard, which can be used to improve the context of action buttons of keyboards on mobile device.

The enterkeyhint content attribute is an enumerated attribute that specifies what action label (or icon) to present for the enter key on virtual keyboards. This allows authors to customize the presentation of the enter key in order to make it more helpful for users.

It allows the following fixed values: enter, done, go, next, previous, search and send. Let’s have a look at those values and the resulting keyboard style on iOS:

<input>

The default behavior without any value.

<input enterkeyhint=”enter”>

The user agent should present a cue for the operation ‘enter’, typically inserting a new line.

<input enterkeyhint=”done”>

The user agent should present a cue for the operation ‘done’, typically meaning there is nothing more to input and the input method editor (IME) will be closed.

<input enterkeyhint=”go”>

The user agent should present a cue for the operation ‘go’, typically meaning to take the user to the target of the text they typed.

<input enterkeyhint=”next”>

The user agent should present a cue for the operation ‘next’, typically taking the user to the next field that will accept text.

<input enterkeyhint=”previous”>

The user agent should present a cue for the operation ‘previous’, typically taking the user to the previous field that will accept text.

<input enterkeyhint=”search”>

The user agent should present a cue for the operation ‘search’, typically taking the user to the results of searching for the text they have typed.

<input enterkeyhint=”send”>

The user agent should present a cue for the operation ‘send’, typically delivering the text to its target.

Photo by Melisa Hildt on Unsplash

Synology: How do I update an existing Docker container with a new image?

As always: before you do such an update, make sure to create a backup of all your files. If something goes wrong, this may lead to data loss!

To update an existing Docker container, the following steps are necessary;

  1. Go to Registry and download new image (mostly the “latest” version)
  2. Go to Container, select the container you need to update and stop it
  3. From Actions menu select Clear
  4. Start the container again

This will clear the complete container and start with the newly downloaded Docker image. Since the data folders are mounted into the container, this will not erase the apllications data. Configurations are also not affected by this.

Photo by sergio souza on Unsplash

Android Studio: when shortcuts do not work on macOS

Compared to other IntelliJ® based software, some shortcuts in Android Studio did not work for me. For example cmd + shift + F, which should open the global search did not work.

The reason for this is the keymap setting that was set to IntelliJ IDEA Classic. Setting the keymap to macOS (as shown in the figure below) solved the issue.

Android Studio Keymap settings

Flutter on iOS: themeMode does not change to dark mode if `ThemeMode.system` is used

In my case, a simple app should automatically use the theme (light or dark) of the system to style the user interface. By default, this should work when using ThemeMode.system (see flutter documentation). But it didn’t.

The themes have been defined as follows:

    return MaterialApp(
      themeMode: ThemeMode.system,
      theme: ThemeData( ... ),
      darkTheme: ThemeData( ...),
      ...
    );

In addition, the WidgetsBindingObserver callback didChangePlatformBrightness() was never called. It was defined as follows:

class MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver
{
  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
  }

  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }

  @override
  void didChangePlatformBrightness() {
    print(WidgetsBinding.instance.window.platformBrightness);
    // > should print Brightness.light / Brightness.dark when you switch
    super.didChangePlatformBrightness();
  }
}

After hours and days of searching, it turned out, that the following definition was set in info.plist of iOS:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

Removing this line solved the issue. This setting sets the apps theme to Light, which results in a constant value even if the user changed the brightness to dark. Without this line, UIUserInterfaceStyle depends on the global setting.

Source: https://stackoverflow.com/questions/61620332/platform-brightness-is-still-light-on-ios-even-when-dark-mode-is-on-flutter

fatal error: ‘Flutter/Flutter.h’ file not found

After switching the flutter channel to beta and back to stable, my app did not compile anymore. The compilation stopped with the error:

fatal error: 'Flutter/Flutter.h' file not found

Multiple flutter clean and channel switches did not work in this case.

The following commands fixed this behavior:

rm ios/Flutter/Flutter.podspec
flutter clean

See: https://github.com/flutter/flutter/issues/70895#issuecomment-744734693

Swift: how to create a Singleton pattern

What is a Singleton?

A singleton pattern guarantees that only one instance of a class is initialized and available from different points of an app.

Some examples are already available in Apple’s frameworks:

// Shared URL Session
let sharedURLSession = URLSession.shared

// Default File Manager
let defaultFileManager = FileManager.default

// Standard User Defaults
let standardUserDefaults = UserDefaults.standard

How to define a Singleton

Often a static constant is used to adopt the Singleton pattern. To do that the reference to the shared instance is stored inside a static constant. In addition, the initializer is private and therefore hidden:

class NetworkManager {
    static let sharedInstance = NetworkManager()

    private init() { }

    func doSomething() {
        // ...
    }
}

By making the initializer method private, it’s guaranteed that no other instance of this class can be created. It would also be possible to move the static constant outside the class, but then the initializer might be accessible and that’s not what we want.

To access our NetworkManager instance just call:

NetworkManager.sharedInstance.doSomething()
NetworkManager.sharedInstance.doSomething()

This approach allows to use always the same instance, even in different points of the app.

Note to Self Mail: create text templates for faster notes

Note To Self Mail

With the latest update 1.13.0 of Note to Self Mail, new text features have been introduced:

  • create static or dynamic text templates for faster input of contents
  • format the note text by using check lists or bullet lists

Use static or dynamic text templates

Text templates can be used for the input of repetitive contents. They can not only contain any static text, they can be extended with dynamic contents that are automatically replaced, when the template is inserted into the note. This includes: date, time, datetime or a unix timestamp. If you need additional contents, please let me know.

Text template selection

The first template uses Date as dynamic contents. Inserted into the note, it automatically adds the current date.

Text template with dynamic contents (date)

Text format: check and bullet lists

By default, a bullet list could already be used in previous versions of the app. Now, another toolbar action was added to insert also bullet lists. Both lists are made of pure text (without any html) to ensure a plain text note and therefore an easier parsing of the note in your inbox.

The app will handle the format of both of those lists automatically. Means, a new list item will automatically created with each new line.

Toolbar action for text format / check list in the note

Another helpful feature is the status change of check lists. Touching a checkbox will enable / disable the checkbox (see “Honey”).

Note text converted into a bullet list

Hope this helps to make your notes faster and more structured 🙂

TRÅDRFRI: two controllers for a group of lamps

TRÅDRFRI

By default, a group of lamps (or even a single lamp) can only be controlled by a single TRÅDRFRI controller. But in different situations, it would be better to have multiple controllers to control the lamps, e.g. on a long floor.

This scenario is not described by IKEA and therefore theoretically not supported. But wait… the following steps allow to create a “copy” of controller that can control the same group of lamps (or single lamp).

The starting point is: having a group of lamps or a single lamp paired with a TRÅDRFRI controller.

  1. Reset a new TRÅDRFRI controller (press the ? symbol on the back 4 times)
  2. Place the new and the existing controller next to each other
  3. Hold both of the ? symbol
    1. red light appears … hold the buttons
    2. red light switches off … paring finished
  4. Now it’s possible to use both controllers for the same group of lamps or single lamp

Source: https://www.107er.net/