/** * @return list of {@link Wrapper}s for registered receivers */ public List<Wrapper> getRegisteredReceivers() { return getShadowInstrumentation().getRegisteredReceivers(); }
public float getHistoricalAxisValue(int axis, int pointerIndex, int historicalIndex) { float value = getHistoricalRawPointerCoords(pointerIndex, historicalIndex).getAxisValue(axis); switch (axis) { case AMOTION_EVENT_AXIS_X: return value + mXOffset; case AMOTION_EVENT_AXIS_Y: return value + mYOffset; } return value; }
/** * @return return the view set with {@link AlertDialog.Builder#setCustomTitle(View)} */ public View getCustomTitleView() { return getShadowAlertController().getCustomTitleView(); }
/** * @return the view set with {@link AlertDialog.Builder#setView(View)} */ public View getView() { return getShadowAlertController().getView(); }
/** * @return the message displayed in the dialog */ public CharSequence getMessage() { return getShadowAlertController().getMessage(); }
/** * @return the icon set with {@link AlertDialog.Builder#setIcon(int)} */ public int getIconId() { return getShadowAlertController().getIconId(); }
/** * Adds a simulated display. * * @param qualifiersStr the {@link Qualifiers} string representing characteristics of the new * display. * @return the new display's ID */ public static int addDisplay(String qualifiersStr) { return getShadowDisplayManagerGlobal().addDisplay(createDisplayInfo(qualifiersStr, null)); }
@Override public void callOnDetachedFromWindow() { super.callOnDetachedFromWindow(); }
/** * Consumes the most recent {@code Intent} started by * {@link android.content.Context#startService(android.content.Intent)} and returns it. * * @return the most recently started {@code Intent} */ public Intent getNextStartedService() { return getShadowInstrumentation().getNextStartedService(); }
/** * Returns the most recent {@code Intent} started by * {@link android.content.Context#startService(android.content.Intent)} without consuming it. * * @return the most recently started {@code Intent} */ public Intent peekNextStartedService() { return getShadowInstrumentation().peekNextStartedService(); }
/** * Clears all {@code Intent} started by * {@link android.content.Context#startService(android.content.Intent)}. */ public void clearStartedServices() { getShadowInstrumentation().clearStartedServices(); }
public void setComponentNameAndServiceForBindServiceForIntent( Intent intent, ComponentName name, IBinder service) { getShadowInstrumentation() .setComponentNameAndServiceForBindServiceForIntent(intent, name, service); }
public static void setUpDisplay(Configuration configuration, DisplayMetrics displayMetrics) { if (Build.VERSION.SDK_INT == VERSION_CODES.JELLY_BEAN) { ShadowWindowManagerImpl.configureDefaultDisplayForJBOnly(configuration, displayMetrics); } else { ShadowDisplayManager.configureDefaultDisplay(configuration, displayMetrics); } }
/** * Removes a simulated display. * * @param displayId the display id to remove */ public static void removeDisplay(int displayId) { getShadowDisplayManagerGlobal().removeDisplay(displayId); }
/** * Clears all {@code Intent}s started by {@link * ContextWrapper#startActivity(android.content.Intent)}. */ public void clearNextStartedActivities() { getShadowInstrumentation().clearNextStartedActivities(); }
/** * Consumes the {@code Intent} requested to stop a service by * {@link android.content.Context#stopService(android.content.Intent)} * from the bottom of the stack of stop requests. */ public Intent getNextStoppedService() { return getShadowInstrumentation().getNextStoppedService(); }
/** * Consumes the most recent {@code Intent} started by {@link * ContextWrapper#startActivity(android.content.Intent)} and returns it. * * @return the most recently started {@code Intent} */ public Intent getNextStartedActivity() { return getShadowInstrumentation().getNextStartedActivity(); }
/** * Returns the most recent {@code Intent} started by {@link * ContextWrapper#startActivity(android.content.Intent)} without consuming it. * * @return the most recently started {@code Intent} */ public Intent peekNextStartedActivity() { return getShadowInstrumentation().peekNextStartedActivity(); }
/** * Writes a value to the next range of bytes. * * <p>Writes are aligned to 4-byte regions. */ private void writeValue(int unpaddedSizeBytes, Object o) { // Create the item with its final, aligned byte size. writeItem(new FakeEncodedItem(alignToInt(unpaddedSizeBytes), o)); } }
@Override public void callOnAttachedToWindow() { super.callOnAttachedToWindow(); }