@@ -0,0 +1,1717 @@
+package com.growthbeat.message.handler;%0A%0Aimport android.content.Context;%0Aimport android.content.Intent;%0A%0Aimport com.growthbeat.message.model.Message;%0Aimport com.growthbeat.message.view.MessageActivity;%0A%0Apublic abstract class BaseMessageHandler implements MessageHandler %7B%0A%0A    protected Context context;%0A    private ShowMessageHandler.MessageRenderHandler renderHandler;%0A%0A    public BaseMessageHandler(Context context) %7B%0A        this.context = context;%0A    %7D%0A%0A    @Override%0A    public abstract boolean handle(final Message message, ShowMessageHandler showMessageHandler);%0A%0A    protected void showMessage(final Message message, final ShowMessageHandler showMessageHandler) %7B%0A%0A        this.renderHandler = new ShowMessageHandler.MessageRenderHandler() %7B%0A            @Override%0A            public void render() %7B%0A                startActivity(message);%0A            %7D%0A        %7D;%0A%0A        ImageDownloader imageDownloader = new ImageDownloader(context, message, context.getResources().getDisplayMetrics().density, new ImageDownloader.Callback() %7B%0A%0A            @Override%0A            public void success() %7B%0A%0A                if (showMessageHandler != null) %7B%0A                    showMessageHandler.complete(renderHandler);%0A                %7D else %7B%0A                    renderHandler.render();%0A                %7D%0A            %7D%0A%0A            @Override%0A            public void failure() %7B%0A            %7D%0A%0A        %7D);%0A%0A        imageDownloader.download();%0A%0A    %7D%0A%0A    protected void startActivity(Message message) %7B%0A%0A        Intent intent = new Intent(context, MessageActivity.class);%0A        intent.putExtra(%22message%22, message);%0A        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);%0A        context.startActivity(intent);%0A%0A    %7D%0A%0A%7D%0A

Create BaseMessageHandler