{ "id": "174934", "key": "TIMOB-27859", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-11-25T15:11:23.000+0000", "created": "2020-04-21T17:29:12.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "TabGroup", "android", "badge", "parity", "tab" ], "versions": [], "issuelinks": [ { "id": "58627", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "174621", "key": "TIMOB-27714", "fields": { "summary": "Android: Add \"Material Components\" theme support", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-25T15:11:23.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nWe currently only support displaying badges in {{TabGroup}} tabs on iOS. We should add support to Android for parity.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Tab-property-badge\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Tab-property-badgeColor\r\n\r\n*To-Do:*\r\nFor the top tab style, we can use the \"material\" {{TabLayout.Tab}} class' {{getOrCreateBadge()}} and {{removeBadge()}} APIs.\r\nhttps://developer.android.com/reference/com/google/android/material/tabs/TabLayout.Tab\r\n\r\nFor the bottom tab style, we can use the \"material\" {{BottomNavigationView}} class' {{getOrCreateBadge()}} and {{removeBadge()}} APIs.\r\nhttps://developer.android.com/reference/com/google/android/material/bottomnavigation/BottomNavigationView\r\n\r\nBoth of the above tab classes use the \"material\" {{BadgeDrawable}} class which provides APIs such as {{setNumber()}}, {{setBackgroundColor()}}, etc.\r\nhttps://developer.android.com/reference/com/google/android/material/badge/BadgeDrawable\r\n", "attachment": [], "flagged": false, "summary": "Android: Add \"badge\" support to TabGroup", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "455235", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-04-26T15:58:51.000+0000", "updated": "2020-04-26T15:58:51.000+0000" }, { "id": "455294", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], will the badges not render correctly without the material theme? Is it a layout issue? Color issue?\r\n\r\n_*Side Note:*_\r\n_Switching Titanium to use the material theme by default seemed like a breaking-change. So, we've punted on it for the moment. We'll probably look into it again for Titanium 10.0.0._", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-29T03:01:25.000+0000", "updated": "2020-04-29T03:01:25.000+0000" }, { "id": "455295", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "the app will crash with:\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [356,787] Unable to start activity ComponentInfo{com.bottom/org.appcelerator.titanium.TiActivity}: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:248)\r\n[ERROR] TiExceptionHandler: com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:222)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.(BadgeDrawable.java:361)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.createFromAttributes(BadgeDrawable.java:294)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.create(BadgeDrawable.java:262)\r\n[ERROR] TiExceptionHandler: com.google.android.material.bottomnavigation.BottomNavigationMenuView.getOrCreateBadge(BottomNavigationMenuView.java:647)\r\n[ERROR] TiExceptionHandler: com.google.android.material.bottomnavigation.BottomNavigationView.getOrCreateBadge(BottomNavigationView.java:674)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.updateBadge(TiUIBottomNavigationTabGroup.java:287)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.updateDrawablesAfterNewItem(TiUIBottomNavigationTabGroup.java:188)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.addTabItemInController(TiUIBottomNavigationTabGroup.java:170)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIAbstractTabGroup.addTab(TiUIAbstractTabGroup.java:247)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.addTab(TiUIBottomNavigationTabGroup.java:64)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:480)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.onWindowActivityCreated(TabGroupProxy.java:462)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:747)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:7825)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:7814)\r\n[ERROR] TiExceptionHandler: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)\r\n[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:107)\r\n[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:214)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7356)\r\n[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)\r\n{code}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-04-29T05:35:39.000+0000", "updated": "2020-04-29T05:35:39.000+0000" }, { "id": "455300", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've added the missing {{badgeColor}}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-04-29T15:08:57.000+0000", "updated": "2020-04-29T15:08:57.000+0000" }, { "id": "455304", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hmm... perhaps a good interim solution is to change Titanium's default theme from...\r\n{{Theme.AppCompat}}\r\n\r\n...to Google's material \"bridge\" themes...\r\nhttps://github.com/material-components/material-components-android/blob/master/docs/getting-started.md#bridge-themes-bridge-themes\r\nhttps://material.io/develop/android/docs/getting-started/#bridge-themes\r\n\r\nI'll have to experiment with this on my end.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-29T16:41:31.000+0000", "updated": "2020-04-29T20:04:27.000+0000" }, { "id": "456451", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], I'm working on switching Titanium's default theme from {{\"Theme.AppCompat\"}} to {{\"Theme.MaterialComponents.Bridge\"}} for 9.3.0 now. Google's Bridge theme derives from AppCompat and so far looks to be completely backward compatible... and it preserves the current color scheme which avoids breaking-changes. It's looking pretty positive so far.\r\n\r\nThe only problem is app developers can replace the default app theme with their own. Most people usually make their own custom theme which derives from {{\"Theme.AppCompat\"}}, which will cause a crash with any AndroidX widget that requires the material theme. Not sure what we can do other than to let it crash and tell people to change the parent theme.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-13T04:15:16.000+0000", "updated": "2020-08-13T04:15:16.000+0000" }, { "id": "457214", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, Waiting on Jenkins build. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-08T13:35:11.000+0000", "updated": "2020-10-08T13:35:11.000+0000" }, { "id": "457720", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Improvement verified in SDK version {{9.3.0.v20201125050632}}.\r\n\r\nTest and other information can be found at:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/11659", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-25T15:11:16.000+0000", "updated": "2020-11-25T15:11:16.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }