Home
last modified time | relevance | path

Searched refs:trapezoidIndex (Results 1 – 4 of 4) sorted by relevance

/packages/apps/Settings/src/com/android/settings/fuelgauge/
DBatteryChartView.java70 void onSelect(int trapezoidIndex); in onSelect() argument
269 final int trapezoidIndex = getTrapezoidIndex(mTouchUpEvent.getX()); in onClick() local
271 if (trapezoidIndex == SELECTED_INDEX_INVALID in onClick()
272 || !isValidToDraw(trapezoidIndex)) { in onClick()
276 if (trapezoidIndex == mSelectedIndex) { in onClick()
279 setSelectedIndex(trapezoidIndex); in onClick()
537 private boolean isValidToDraw(int trapezoidIndex) { in isValidToDraw() argument
539 && trapezoidIndex >= 0 in isValidToDraw()
540 && trapezoidIndex < mLevels.length - 1 in isValidToDraw()
541 && mLevels[trapezoidIndex] != 0 in isValidToDraw()
[all …]
DBatteryChartPreferenceController.java238 public void onSelect(int trapezoidIndex) { in onSelect() argument
239 Log.d(TAG, "onChartSelect:" + trapezoidIndex); in onSelect()
240 refreshUi(trapezoidIndex, /*isForce=*/ false); in onSelect()
243 trapezoidIndex == BatteryChartView.SELECTED_INDEX_ALL in onSelect()
324 boolean refreshUi(int trapezoidIndex, boolean isForce) { in refreshUi() argument
328 || (mTrapezoidIndex == trapezoidIndex && !isForce)) { in refreshUi()
332 trapezoidIndex, mBatteryIndexedMap.size(), isForce)); in refreshUi()
334 mTrapezoidIndex = trapezoidIndex; in refreshUi()
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/
DBatteryChartPreferenceControllerTest.java253 final int trapezoidIndex = 1; in testRefreshUi_trapezoidIndexIsNotChanged_ignoreRefresh() local
254 mBatteryChartPreferenceController.mTrapezoidIndex = trapezoidIndex; in testRefreshUi_trapezoidIndexIsNotChanged_ignoreRefresh()
256 trapezoidIndex, /*isForce=*/ false)).isFalse(); in testRefreshUi_trapezoidIndexIsNotChanged_ignoreRefresh()
261 final int trapezoidIndex = 1; in testRefreshUi_forceUpdate_refreshUi() local
262 mBatteryChartPreferenceController.mTrapezoidIndex = trapezoidIndex; in testRefreshUi_forceUpdate_refreshUi()
264 trapezoidIndex, /*isForce=*/ true)).isTrue(); in testRefreshUi_forceUpdate_refreshUi()
280 final int trapezoidIndex = 1; in testRemoveAndCacheAllPrefs_emptyContent_ignoreRemoveAll() local
284 trapezoidIndex, /*isForce=*/ true); in testRemoveAndCacheAllPrefs_emptyContent_ignoreRemoveAll()
290 final int trapezoidIndex = 1; in testRemoveAndCacheAllPrefs_buildCacheAndRemoveAllPreference() local
298 trapezoidIndex, /*isForce=*/ true); in testRemoveAndCacheAllPrefs_buildCacheAndRemoveAllPreference()
DBatteryChartViewTest.java105 trapezoidIndex -> { in testSetSelectedIndex_invokesCallback()
106 selectedIndex[0] = trapezoidIndex; in testSetSelectedIndex_invokesCallback()
122 trapezoidIndex -> { in testSetSelectedIndex_sameIndex_notInvokesCallback()
123 selectedIndex[0] = trapezoidIndex; in testSetSelectedIndex_sameIndex_notInvokesCallback()