Search in sources :

Example 6 with FullScreenSwipeRefreshLayout

use of com.klinker.android.twitter.views.swipe_refresh_layout.FullScreenSwipeRefreshLayout in project Talon-for-Twitter by klinker24.

the class UserListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, null);
    settings = AppSettings.getInstance(context);
    View layout = LayoutInflater.from(context).inflate(R.layout.ptr_list_layout, container, false);
    changeNoRetweetersText(layout);
    mPullToRefreshLayout = (FullScreenSwipeRefreshLayout) layout.findViewById(R.id.swipe_refresh_layout);
    mPullToRefreshLayout.setOnRefreshListener(new FullScreenSwipeRefreshLayout.OnRefreshListener() {

        @Override
        public void onRefresh() {
            onRefreshStarted();
        }
    });
    if (settings.addonTheme) {
        mPullToRefreshLayout.setColorScheme(settings.accentInt, SwipeProgressBar.COLOR2, settings.accentInt, SwipeProgressBar.COLOR3);
    } else {
        if (settings.theme != AppSettings.THEME_LIGHT) {
            mPullToRefreshLayout.setColorScheme(context.getResources().getColor(R.color.app_color), SwipeProgressBar.COLOR2, context.getResources().getColor(R.color.app_color), SwipeProgressBar.COLOR3);
        } else {
            mPullToRefreshLayout.setColorScheme(context.getResources().getColor(R.color.app_color), getResources().getColor(R.color.light_ptr_1), context.getResources().getColor(R.color.app_color), getResources().getColor(R.color.light_ptr_2));
        }
    }
    spinner = (LinearLayout) layout.findViewById(R.id.list_progress);
    noContent = (LinearLayout) layout.findViewById(R.id.no_content);
    listView = (AsyncListView) layout.findViewById(R.id.listView);
    BitmapLruCache cache = App.getInstance(context).getBitmapCache();
    ArrayListLoader loader = new ArrayListLoader(cache, context);
    ItemManager.Builder builder = new ItemManager.Builder(loader);
    builder.setPreloadItemsEnabled(true).setPreloadItemsCount(50);
    builder.setThreadPoolSize(4);
    listView.setItemManager(builder.build());
    tweetId = getArguments().getLong("id", 0);
    onRefreshStarted();
    return layout;
}
Also used : BitmapLruCache(uk.co.senab.bitmapcache.BitmapLruCache) ArrayListLoader(com.klinker.android.twitter.adapters.ArrayListLoader) ItemManager(org.lucasr.smoothie.ItemManager) FullScreenSwipeRefreshLayout(com.klinker.android.twitter.views.swipe_refresh_layout.FullScreenSwipeRefreshLayout) AsyncListView(org.lucasr.smoothie.AsyncListView) View(android.view.View)

Aggregations

FullScreenSwipeRefreshLayout (com.klinker.android.twitter.views.swipe_refresh_layout.FullScreenSwipeRefreshLayout)6 ItemManager (org.lucasr.smoothie.ItemManager)6 BitmapLruCache (uk.co.senab.bitmapcache.BitmapLruCache)6 ArrayListLoader (com.klinker.android.twitter.adapters.ArrayListLoader)5 View (android.view.View)4 AbsListView (android.widget.AbsListView)4 AsyncListView (org.lucasr.smoothie.AsyncListView)4 ListView (android.widget.ListView)3 Point (android.graphics.Point)2 Intent (android.content.Intent)1 ViewConfiguration (android.view.ViewConfiguration)1 CursorListLoader (com.klinker.android.twitter.adapters.CursorListLoader)1 Field (java.lang.reflect.Field)1 TwitterException (twitter4j.TwitterException)1