accessibility – How should a screen reader pronounce links and buttons?

When a screen reader reads links, should they be pronounced as ‘Link button’, or ‘Link’?

Example: Show more… (a link): should the screen reader say ‘Link button’, or ‘Link’?

Also, how should the screen reader read an icon button? Should it read as ‘Icon button’ or ‘button’?

8 – How to show error on screen after failling a webservice call on Webform submitForm?

I made a custom handler for one of my webform to call a service when the form is submitted. Here is my code. It is working when the service return a response with status code = 200 but I cannot find a way to notify the view when an error is raised by the webservice. I would like to show a modal with an error message but cannot find how to do this.

class CRMWebformHandler extends WebformHandlerBase {

  public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
    try {
      $data = array(
        'firstName' => $webform_submission->getData()('lastname'),
        'lastName' => $webform_submission->getData()('firstname'),
        'civility' => $webform_submission->getData()('civility'),
        'email' => $webform_submission->getData()('email'),
      );
     
      $payload = json_encode($data);
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_HTTPHEADER, ('Content-Type: application/json'));
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
      curl_setopt($curl, CURLOPT_URL, "https://my-url.com");
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

      $result = curl_exec($curl);
      curl_close($curl);

      $json = json_decode($result, TRUE);
      $succeed = is_bool($json) ? $json : FALSE;
      if (!$succeed && curl_getinfo($curl, CURLINFO_HTTP_CODE) !== 200) {
        throw new Exception('No valid response from server.');
      }
    }
    catch (Exception $exception) {
      Drupal::messenger()->addError('No valid response from server.');
      return;
    }
  }
}

screen – How to take screenshots without using buttons?

Tasker app can do this without root.

Install Tasker. Setup a Task named Capture Screenshot and add the following actions:

  1. Display → Status bar → Set: Collapsed.

  2. Task → Wait → MS: 500

  3. Display → Take Screenshot → File:%DATE-%TIMES → tick Insert in Gallery.

  4. Optional: since Tasker doesn’t visibly show whether it took a screenshot or not, you can configure your task to show a toast or a notification that screenshot has been taken. Both toast and notification can be added from Alert section.

  5. Set an icon for the task.

For the ease of use I suggest you attach this task to a quick setting tile. Tasker offers three tiles. You can access them and add them into your enabled tiles through the quick settings editor (the pencil icon in your quick settings) and drag the ‘unset’ named tile to visible tiles.

After that, go into Tasker, click three dots lines, select Action and under Quick Settings Tasks replace the entry named unset with the name of the task you just created. Make sure you change it only for the entry you dragged into visible tiles.

From now on, whenever you would tap that quick setting tile, it would collapse the notification bar, wait for 500ms, than capture a screenshot.

In practice, Tasker responsded with an automatic delay of at least 3 seconds when tapping the tile. I have no solution for this delay though.

Why “Press Any Button to Continue” screen in beginning of games?

I believe it is mostly for presentation. I consider that screen a sort of doorway for people to enter the game. Consider this screen:

enter image description here

Like the cover of a book, a title sequence to a movie, or an intro track to a music album, the “press any button to continue” screen is a hint of what it’s all about. It gives you some time to soak in the atmosphere without thinking about creating a new file, control settings, difficulty level, what have you. If you can accept the value of such a screen, your question narrows down to interactivity.

Why don’t they just include the menu on this screen?

The same reason why you don’t put a table of contents on the book cover. Granted, book covers are visible on the shelf whereas the start screen is a little bit deeper into the experience. But I doubt many people would want the table of contents on the covers of their favorite books just for the utility.

Why doesn’t the screen just automatically move on to the menu?

Because now you have less control. Pressing “any button” is much less annoying than having to wait 2 seconds every time you start up the game.

If you don’t think this screen is worth anything in the first place, well then it’s just a matter of creative differences. This is a presentation issue and very much on the artistic side of UX. I personally love this screen, and pressing that first button is always pleasurable to me.

authorization – Is a consent screen in an OAuth 2.0 implementation optional

I’ve read through RFC 6749: https://datatracker.ietf.org/doc/html/rfc6749

The only mention of consent is in this bit:

The authorization server MUST implement CSRF protection for its
authorization endpoint and ensure that a malicious client cannot
obtain authorization without the awareness and explicit consent of
the resource owner.

The above does not (to me anyway) translate to: “Hey show a consent screen with requested scopes before responding with an authorisation”.

I’ve seen so many OAuth 2.0 implementations however where a consent screen is shown.

Question 1: As per the title really – is it actually needed?

Question 2: Is there an RFC that specifies what such a consent screen (if you are to implement one) should look like, including any required messaging and response if the user declines?

Screen showing vertical coloured lines and is not responding to touch

I have an Infinix Zero 5, and its screen has stopped working. It is just displaying multi-coloured vertical lines and is not responding to any touch. The power and volume buttons of the phone are still functional, the fingerprint scanner still works (as the display turns on when it is scanned) and the display even dims when the phone reaches the display timeout.

The phone hasn’t been dropped or anything, and the screen initially appeared after taking it out of my pocket. When I restarted the phone the first time (by holding down the power button), it started working again, but now even when restarting the phone, the display still shows these lines. I know the phone is still in working order as off and on the phone vibrates for notifications.

Is this a display issue for which I have to replace the screen or is there some other problem with the phone?

Phone with broken screen

Why does temperature disappear from At A Glance and the lock screen?

It disappeared out of the blue a few weeks ago. I searched the web and did a trick to make it reappear. It was shown for weeks and then suddenly disappeared again a few days ago.

What causes this, a bug?

why is reported screen size smaller than display size with GLFW full screen window

I’m using GLFW to create a full screen GL application. I’m running it on my Ubuntu 20.04 laptop that has a typical 1920:1080 display, at least that’s the screen resolution reported under Settings->Displays. When I run the following code:

int monitor_x = 0;
int monitor_y = 0;
int monitor_width = 0;
int monitor_height = 0;

    GLFWmonitor *monitor = glfwGetPrimaryMonitor();
    glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
    printf("before monitor %d, %d, %d, %dn", monitor_x, monitor_y, monitor_width, monitor_height);
    window = glfwCreateWindow(1920, 1080, "OpenGL", glfwGetPrimaryMonitor(), nullptr); // Fullscreen
    glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
    printf("after monitor %d, %d, %d, %dn", monitor_x, monitor_y, monitor_width, monitor_height);

When I run the code, get the following output on stdout:

before monitor 72, 27, 1848, 1053
after monitor 72, 27, 1848, 1053

Also, it seems as if there’s a horizontal band at the top and a vertical band at the right of the full screen that remains the background color, no matter what my application attempts to write to those areas.

So 72 + 1848 = 1920 and 27 + 1053 = 1080, but it seems that the system is reserving these horizontal and vertical bands for something else that I assume has something to do with that 72 and 27.

Is there some hint or some such thing that i need to specify in order to make the entire 1920 by 1080 of the screen available for rendering?

Thanks