Skip to content

Commit

Permalink
ART - Sub App - Fan and Artist Communities - onUpdateViewOnUIThread
Browse files Browse the repository at this point in the history
Implemented onUpdateViewOnUIThread which listen to broadcaster to fire a thread.

Include in: #6252

Signed-off-by: Gabriel Araujo <[email protected]>
  • Loading branch information
GaboHub committed May 26, 2016
1 parent 1794f99 commit fff9e23
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.bitdubai.fermat_api.layer.modules.exceptions.CantGetSelectedActorIdentityException;
import com.bitdubai.fermat_art_api.layer.actor_connection.artist.enums.ArtistActorConnectionNotificationType;
import com.bitdubai.fermat_art_api.layer.actor_connection.fan.enums.FanActorConnectionNotificationType;
import com.bitdubai.fermat_art_api.layer.sub_app_module.community.artist.exceptions.CantListArtistsException;
import com.bitdubai.fermat_art_api.layer.sub_app_module.community.artist.interfaces.ArtistCommunityInformation;
import com.bitdubai.fermat_art_api.layer.sub_app_module.community.artist.interfaces.ArtistCommunitySelectableIdentity;
import com.bitdubai.fermat_art_api.layer.sub_app_module.community.artist.interfaces.ArtistCommunitySubAppModuleManager;
Expand Down Expand Up @@ -381,8 +382,13 @@ public void onUpdateViewOnUIThread(String code){
{
//update intra user list
if(code.equals(ArtistActorConnectionNotificationType.ACTOR_CONNECTED.getCode())){
invalidate();
onRefresh();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
invalidate();
onRefresh();
}
});
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,13 @@ public void onUpdateViewOnUIThread(String code){
{
//update intra user list
if(code.equals(FanActorConnectionNotificationType.ACTOR_CONNECTED.getCode())){
invalidate();
onRefresh();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
invalidate();
onRefresh();
}
});
}
}
catch(Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void handleArtistUpdateEvent() throws CantHandleNewsEventException {
case ACCEPT:
this.handleAcceptConnection(request.getRequestId());
broadcaster.publish(
BroadcasterType.NOTIFICATION_SERVICE,
BroadcasterType.UPDATE_VIEW,
SubAppsPublicKeys.ART_ARTIST_COMMUNITY.getCode(),
ArtistActorConnectionNotificationType.ACTOR_CONNECTED.getCode());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,15 @@ public void handleAcceptConnection(final UUID connectionId, final EventSource ev
);
if (eventSource == EventSource.ACTOR_NETWORK_SERVICE_ARTIST){
broadcaster.publish(
BroadcasterType.NOTIFICATION_SERVICE,
BroadcasterType.UPDATE_VIEW,
SubAppsPublicKeys.ART_ARTIST_COMMUNITY.getCode(),
ArtistActorConnectionNotificationType.ACTOR_CONNECTED.getCode());
artistNetworkService.confirm(connectionId);
}
else{
fanNetworkService.confirm(connectionId);
broadcaster.publish(
BroadcasterType.NOTIFICATION_SERVICE,
BroadcasterType.UPDATE_VIEW,
SubAppsPublicKeys.ART_FAN_COMMUNITY.getCode(),
FanActorConnectionNotificationType.ACTOR_CONNECTED.getCode());
}
Expand Down

0 comments on commit fff9e23

Please sign in to comment.