當前位置: 首頁>>代碼示例>>Java>>正文


Java SwipeRefreshLayout.post方法代碼示例

本文整理匯總了Java中android.support.v4.widget.SwipeRefreshLayout.post方法的典型用法代碼示例。如果您正苦於以下問題:Java SwipeRefreshLayout.post方法的具體用法?Java SwipeRefreshLayout.post怎麽用?Java SwipeRefreshLayout.post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.widget.SwipeRefreshLayout的用法示例。


在下文中一共展示了SwipeRefreshLayout.post方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_video_pager,container, false);
    listView=(RecyclerView)view.findViewById(R.id.list);
    listView.setHasFixedSize(true);
    listView.setLayoutManager(new StaggeredGridLayoutManager(1, LinearLayoutManager.VERTICAL));
    List<ItemList> lists=new ArrayList<ItemList>();
    videoadapter=new VideoAdapter(lists);
    listView.setAdapter(videoadapter);

    mPresent=new VideoPresenter((VideoData.View) this);

    srfLayout=(SwipeRefreshLayout)view.findViewById(R.id.srf_layout);
    srfLayout.setOnRefreshListener(this);
    srfLayout.post(() -> onRefresh());
    return view;
}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:19,代碼來源:CeshiFragment.java

示例2: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_video_pager, container, false);
    listView = (RecyclerView) view.findViewById(R.id.list);
    listView.setHasFixedSize(true);
    listView.setLayoutManager(new StaggeredGridLayoutManager(1, LinearLayoutManager.VERTICAL));
    List<ItemList> lists = new ArrayList<ItemList>();
    videoadapter = new VideoAdapter(lists);
    listView.setAdapter(videoadapter);

    mPresent = new VideoPresenter((VideoData.View) this);

    srfLayout = (SwipeRefreshLayout) view.findViewById(R.id.srf_layout);
    srfLayout.setOnRefreshListener(this);
    srfLayout.post(() -> onRefresh());
    return view;
}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:19,代碼來源:LifeFragment.java

示例3: setLoadingIndicator

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
public void setLoadingIndicator(final boolean active) {

    if (getView() == null) {
        return;
    }
    final SwipeRefreshLayout srl =
            (SwipeRefreshLayout) getView().findViewById(R.id.refresh_layout);

    // Make sure setRefreshing() is called after the layout is done with everything else.
    srl.post(new Runnable() {
        @Override
        public void run() {
            srl.setRefreshing(active);
        }
    });
}
 
開發者ID:Captwalloper,項目名稱:NUI_Project,代碼行數:18,代碼來源:PlaylistFragment.java

示例4: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppThemeStaffLogin);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_staff_desk);

    deskListGlobal = new ArrayList<>();

    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
    swipeRefreshLayout.setOnRefreshListener(this);
    swipeRefreshLayout.post(new Runnable() {
                                @Override
                                public void run() {
                                    swipeRefreshLayout.setRefreshing(true);
                                }
                            }
    );

    Request request = new Request(this, url, com.android.volley.Request.Method.GET);
    request.requestVolleyDeskList(this);

    gridView = (GridView) findViewById(R.id.gvDesk);
    gridView.setOnItemClickListener(this);

    getSupportActionBar().setDisplayOptions(android.support.v7.app.ActionBar.DISPLAY_SHOW_CUSTOM);
    getSupportActionBar().setCustomView(R.layout.custom_actionbar);
    tvActionBar = (TextView)getSupportActionBar().getCustomView().findViewById(R.id.tvActionBar);
    ibLogout = (ImageButton) getSupportActionBar().getCustomView().findViewById(R.id.ibLogout);
    ibLogout.setVisibility(View.VISIBLE);
    ibLogout.setOnClickListener(this);
    tvActionBar.setText(getResources().getString(R.string.staffDeskHeader));

    //startService(new Intent(StaffDeskActivity.this, StaffService.class));

}
 
開發者ID:yusufcakal,項目名稱:RestaurantApp,代碼行數:36,代碼來源:StaffDeskActivity.java

示例5: setLoadingIndicator

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
public void setLoadingIndicator(final boolean active) {

    if (getView() == null) {
        return;
    }
    final SwipeRefreshLayout srl = getView().findViewById(R.id.refresh_layout);

    // Make sure setRefreshing() is called after the layout is done with everything else.
    srl.post(() -> srl.setRefreshing(active));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:TasksFragment.java

示例6: showProgress

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
public static void showProgress(@NonNull final Fragment fragment, final SwipeRefreshLayout swipeRefreshLayout, boolean show) {
    if (!fragment.isAdded() || swipeRefreshLayout == null) return;

    if (!show) {
        swipeRefreshLayout.setRefreshing(false);
        return;
    }

    if (fragment.isResumed()) {
        swipeRefreshLayout.setRefreshing(true);
    } else {
        swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true));
    }
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:15,代碼來源:ViewUtils.java

示例7: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    this.context = this;

    appPreferences = App.getAppPreferences();
    packageManager = getPackageManager();

    setInitialConfiguration();
    OtherUtils.requestPermissions(context);

    recyclerView = (RecyclerView) findViewById(R.id.app_list);
    refresh = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh);
    noResults = (LinearLayout) findViewById(R.id.no_results);

    icon = (ImageView) findViewById(R.id.no_results_icon);
    if (appPreferences.getTheme().equals("0")) {
        icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.grey_two));
    }

    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(linearLayoutManager);
    drawer = setNavigationDrawer(context, toolbar, recyclerView, false, appInstalledAdapter, appSystemAdapter, appDisabledAdapter, appHiddenAdapter, appFavoriteAdapter);

    // might be useful in the future
    if (!appPreferences.getInitialSetup()) {
        appPreferences.setInitialSetup(true);
    }

    refresh.setColorSchemeColors(appPreferences.getPrimaryColor());
    refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            refresh.setRefreshing(true);
            new getInstalledApps().execute();
        }
    });

    refresh.post(new Runnable() {
        @Override
        public void run() {
            refresh.setRefreshing(true);
        }
    });
    new getInstalledApps().execute();
}
 
開發者ID:dkanada,項目名稱:OpenAPK,代碼行數:50,代碼來源:MainActivity.java


注:本文中的android.support.v4.widget.SwipeRefreshLayout.post方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。