NativeScript / NativeScript/NativeScript

Feature: Allow Android ActionBarItems to be themable...

Open
#9,164 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backlog feature help wanted
Dominant language
TypeScript
Stars
25.7k
Forks
1.7k
Avg merge
1d 5h
Merged PRs (30d)
35

Description

At the current point the action bar items are not themable via css because they aren't available to change at runtime. However, a workaround is to use a Spannable String as the title, and then theme that probably using the css value ActionBarItem. See:
https://stackoverflow.com/questions/9895472/how-do-i-programmatically-change-actionbar-menuitem-text-colour

Please note:
.setTitleCondensed(rawTitle); should be set before setting the .setTitle with the spannable string, so that it works around a bug on Android 4.1 on some phones.

This would be a nice minor feature to add at some point in the future...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies Android ActionBarItems and the CSS value ActionBarItem; begin by locating the Android ActionBarItem implementation and its runtime title setup around setTitleCondensed and setTitle. Done means ActionBarItems can be themed through CSS at runtime while preserving the Android 4.1 ordering workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, css
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.