Android Open Source - photo-paper Thread Bus






From Project

Back to project page photo-paper.

License

The source code is released under:

MIT License

If you think the Android project photo-paper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.lukekorth.android_500px.helpers;
/* w w w .j  ava  2 s  .  co  m*/
import android.os.Handler;
import android.os.Looper;

import com.squareup.otto.Bus;

public class ThreadBus extends Bus {

    private final Handler mainThread = new Handler(Looper.getMainLooper());

    @Override
    public void post(final Object event) {
        if (Looper.myLooper() == Looper.getMainLooper()) {
            super.post(event);
        } else {
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    ThreadBus.super.post(event);
                }
            });
        }
    }
}




Java Source Code List

com.lukekorth.android_500px.HistoryActivity.java
com.lukekorth.android_500px.PhotoFragment.java
com.lukekorth.android_500px.SearchActivity.java
com.lukekorth.android_500px.SettingsActivity.java
com.lukekorth.android_500px.ViewPhotoActivity.java
com.lukekorth.android_500px.WallpaperApplication.java
com.lukekorth.android_500px.helpers.Cache.java
com.lukekorth.android_500px.helpers.LogReporting.java
com.lukekorth.android_500px.helpers.Settings.java
com.lukekorth.android_500px.helpers.ThreadBus.java
com.lukekorth.android_500px.helpers.Utils.java
com.lukekorth.android_500px.models.ActivityResumedEvent.java
com.lukekorth.android_500px.models.EnableCategoriesEvent.java
com.lukekorth.android_500px.models.Photos.java
com.lukekorth.android_500px.models.SearchCompleteEvent.java
com.lukekorth.android_500px.models.UserUpdatedEvent.java
com.lukekorth.android_500px.models.User.java
com.lukekorth.android_500px.models.WallpaperChangedEvent.java
com.lukekorth.android_500px.receivers.UserPresentReceiver.java
com.lukekorth.android_500px.receivers.WifiReceiver.java
com.lukekorth.android_500px.services.ApiService.java
com.lukekorth.android_500px.services.ClearCacheIntentService.java
com.lukekorth.android_500px.services.UserInfoIntentService.java
com.lukekorth.android_500px.services.WallpaperService.java
com.lukekorth.android_500px.views.FeatureListPreference.java
com.lukekorth.android_500px.views.SquareImageView.java
com.squareup.picasso.PicassoTools.java