diff --git a/ui/action-bar/action-bar.android.ts b/ui/action-bar/action-bar.android.ts index f6d08153a..aae2524c7 100644 --- a/ui/action-bar/action-bar.android.ts +++ b/ui/action-bar/action-bar.android.ts @@ -9,6 +9,8 @@ import application = require("application"); import dts = require("ui/action-bar"); import view = require("ui/core/view"); +const R_ID_HOME = 0x0102002c; + var ACTION_ITEM_ID_OFFSET = 1000; global.moduleMerge(common, exports); @@ -126,7 +128,7 @@ export class ActionBar extends common.ActionBar { return true; } - if (this.navigationButton && itemId === (android).R.id.home) { + if (this.navigationButton && itemId === R_ID_HOME) { this.navigationButton._raiseTap(); return true; } diff --git a/ui/progress/progress.android.ts b/ui/progress/progress.android.ts index 8e8bb6eaa..0b57aa49d 100644 --- a/ui/progress/progress.android.ts +++ b/ui/progress/progress.android.ts @@ -2,6 +2,8 @@ import dependencyObservable = require("ui/core/dependency-observable"); import proxy = require("ui/core/proxy"); +const R_ATTR_PROGRESS_BAR_STYLE_HORIZONTAL = 0x01010078; + function onValuePropertyChanged(data: dependencyObservable.PropertyChangeData) { var progress = data.object; if (!progress.android) { @@ -30,7 +32,7 @@ export class Progress extends common.Progress { private _android: android.widget.ProgressBar; public _createUI() { - this._android = new android.widget.ProgressBar(this._context, null, (android).R.attr.progressBarStyleHorizontal); + this._android = new android.widget.ProgressBar(this._context, null, R_ATTR_PROGRESS_BAR_STYLE_HORIZONTAL); } get android(): android.widget.ProgressBar { diff --git a/ui/segmented-bar/segmented-bar.android.ts b/ui/segmented-bar/segmented-bar.android.ts index 1be3a7e73..18abfdea6 100644 --- a/ui/segmented-bar/segmented-bar.android.ts +++ b/ui/segmented-bar/segmented-bar.android.ts @@ -5,6 +5,10 @@ import proxy = require("ui/core/proxy"); import types = require("utils/types"); import observable = require("data/observable"); +const R_ID_TABS = 0x01020013; +const R_ID_TABCONTENT = 0x01020011; +const R_ATTR_STATE_SELECTED = 0x010100a1; + global.moduleMerge(common, exports); function onSelectedIndexPropertyChanged(data: dependencyObservable.PropertyChangeData) { @@ -79,8 +83,7 @@ function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) { var stateDrawable = new android.graphics.drawable.StateListDrawable(); var arr = java.lang.reflect.Array.newInstance(java.lang.Integer.class.getField("TYPE").get(null), 1); - arr[0] = (android).R.attr.state_selected; - + arr[0] = R_ATTR_STATE_SELECTED; var colorDrawable = new SegmentedBarColorDrawable(view.selectedBackgroundColor.android) stateDrawable.addState(arr, colorDrawable); stateDrawable.setBounds(0, 15, vg.getRight(), vg.getBottom()); @@ -154,11 +157,11 @@ export class SegmentedBar extends common.SegmentedBar { tabHostLayout.setOrientation(android.widget.LinearLayout.VERTICAL); var tabWidget = new android.widget.TabWidget(this._context); - tabWidget.setId((android).R.id.tabs); + tabWidget.setId(R_ID_TABS); tabHostLayout.addView(tabWidget); var frame = new android.widget.FrameLayout(this._context); - frame.setId((android).R.id.tabcontent); + frame.setId(R_ID_TABCONTENT); frame.setVisibility(android.view.View.GONE); tabHostLayout.addView(frame);