本文整理匯總了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;
}
示例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;
}
示例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);
}
});
}
示例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));
}
示例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));
}
示例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));
}
}
示例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();
}