com.squareup.otto.Produce Java Examples
The following examples show how to use
com.squareup.otto.Produce.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MediaControllerService.java From Noyze with Apache License 2.0 | 8 votes |
@Produce public Pair<MediaMetadataCompat, PlaybackStateCompat> produceEvent() { final MediaMetadataCompat metadata; if (null == mController.getMetadata()) { metadata = (new MediaMetadataCompat.Builder()).build(); } else { // If the notification didn't provide an icon, add one! MediaMetadataCompat metadata1 = mController.getMetadata(); String packageName = metadata1.getString(RemoteControlCompat.METADATA_KEY_PACKAGE); if (!metadata1.containsKey(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON) && mLargeIconMap.containsKey(packageName)) { MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder(metadata1); builder.putBitmap(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, mLargeIconMap.get(packageName)); metadata1 = builder.build(); } metadata = metadata1; } return Pair.create(metadata, mController.getPlaybackState()); }
Example #2
Source File: MediaControllerService.java From Noyze with Apache License 2.0 | 6 votes |
@Produce public Pair<MediaMetadataCompat, PlaybackStateCompat> produceEvent() { final MediaMetadataCompat metadata; if (null == mController.getMetadata()) { metadata = (new MediaMetadataCompat.Builder()).build(); } else { // If the notification didn't provide an icon, add one! MediaMetadataCompat metadata1 = mController.getMetadata(); String packageName = metadata1.getString(RemoteControlCompat.METADATA_KEY_PACKAGE); if (!metadata1.containsKey(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON) && mLargeIconMap.containsKey(packageName)) { MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder(metadata1); builder.putBitmap(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, mLargeIconMap.get(packageName)); metadata1 = builder.build(); } metadata = metadata1; } return Pair.create(metadata, mController.getPlaybackState()); }
Example #3
Source File: VolumeAccessibilityService.java From Noyze with Apache License 2.0 | 5 votes |
@Produce public TopApp produceTopApp() { TopApp topApp = new TopApp(); topApp.mCurrentActivityClass = mCurrentActivityClass; topApp.mCurrentPackage = mCurrentActivityPackage; return topApp; }
Example #4
Source File: BitCoinService.java From android-open-project-demo with Apache License 2.0 | 5 votes |
@Produce public GetInfoDoneEvent produceAnswer() { if (mLastTicker != null) return new GetInfoDoneEvent(true, null, mLastTicker); else return new GetInfoDoneEvent(false, null, null); }
Example #5
Source File: PasswordViewFragment.java From masterpassword with GNU General Public License v3.0 | 5 votes |
@Produce public CategoryChangeEvent retrieveActiveCategory() { CategoryChangeEvent event; if (activeCategory != null) { event = new CategoryChangeEvent(activeCategory); } else { event = new CategoryChangeEvent(Category.all(getActivity())); } return event; }
Example #6
Source File: MediaProviderDelegate.java From Noyze with Apache License 2.0 | 5 votes |
@Produce public Metadata.PlaybackEvent producePlaybackEvent() { Metadata.PlaybackEvent event = new Metadata.PlaybackEvent(); event.mMetadata = metadata; event.mPlaybackInfo = playbackInfo; event.mMetadata.hasRemote(true); return event; }
Example #7
Source File: VolumeAccessibilityService.java From Noyze with Apache License 2.0 | 5 votes |
@Produce public TopApp produceTopApp() { TopApp topApp = new TopApp(); topApp.mCurrentActivityClass = mCurrentActivityClass; topApp.mCurrentPackage = mCurrentActivityPackage; return topApp; }
Example #8
Source File: MediaProviderDelegate.java From Noyze with Apache License 2.0 | 5 votes |
@Produce public Metadata.PlaybackEvent producePlaybackEvent() { Metadata.PlaybackEvent event = new Metadata.PlaybackEvent(); event.mMetadata = metadata; event.mPlaybackInfo = playbackInfo; event.mMetadata.hasRemote(true); return event; }
Example #9
Source File: TodoListManager.java From FluxyAndroidTodo with MIT License | 4 votes |
@Produce public RawTodoList produceTodoList() { return new RawTodoList(todoItems); }
Example #10
Source File: TodosActivityStore.java From FluxyAndroidTodo with MIT License | 4 votes |
@Produce public Boolean produceShouldShowUndoButton() { return shouldShowUndoButton; }
Example #11
Source File: TodosActivityStore.java From FluxyAndroidTodo with MIT License | 4 votes |
@Produce public Long produceEditModeActiveForTodoId() { return editModeActiveForTodoId; }
Example #12
Source File: MediaProviderDelegate.java From Noyze with Apache License 2.0 | 4 votes |
@Produce public Metadata.PlaybackPosition producePlaybackPosition() { return new Metadata.PlaybackPosition(playbackInfo.mCurrentPosMs); }
Example #13
Source File: TapchatService.java From tapchat-android with Apache License 2.0 | 4 votes |
@Produce public ServiceReadyEvent produceServiceReadyEvent() { return new ServiceReadyEvent(this); }
Example #14
Source File: TapchatService.java From tapchat-android with Apache License 2.0 | 4 votes |
@Produce public ServiceStateChangedEvent produceServiceStateChangedEvent() { if (mConnectionState != STATE_DISCONNECTED) { return new ServiceStateChangedEvent(this); } return null; }
Example #15
Source File: MediaProviderDelegate.java From Noyze with Apache License 2.0 | 4 votes |
@Produce public Metadata.PlaybackPosition producePlaybackPosition() { return new Metadata.PlaybackPosition(playbackInfo.mCurrentPosMs); }
Example #16
Source File: NotificationService.java From phphub-android with Apache License 2.0 | 4 votes |
@Produce public NotificationChangeEvent notificationChangeEvent() { return new NotificationChangeEvent(notificationLength); }
Example #17
Source File: Application.java From mOrgAnd with GNU General Public License v2.0 | 4 votes |
@Produce public SyncEvent produceSyncEvent() { return this.syncEvent; }
Example #18
Source File: DeviceDiscoveryService.java From Android-BleEventAdapter with Apache License 2.0 | 4 votes |
@Produce public DiscoveredDevicesEvent produceAnswer() { return new DiscoveredDevicesEvent(null, mBluetoothDevices); }
Example #19
Source File: ChatService.java From meatspace-android with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Produce public ChatEvent produce() { return new ChatEvent(true, ioState, chatList); }