Похожие чаты

Check out "Weddplanner Wedding Studio" https://play.google.com/store/apps/details?id=zeekoi.com.weddplanner

3 ответов

18 просмотров

like pinterest I want I was doing it in normal but now sth happens I must figure it out :)

private class mGridItemClickListener implements Parse.OnGridItemClickListener{ @Override public void onGridItemClick(View view, ParseWallpaper wallpaper, int position) { int queryType = Constant.DETAIL_GENERAL_RECENT; if (objectId != null) { queryType = Constant.DETAIL_CATEGORY_RECENT; } int[] startingLocation = new int[2]; view.getLocationOnScreen(startingLocation); startingLocation[0] += view.getWidth() / 2; DetailsActivity.start(getActivity(), position,queryType,objectId,startingLocation); getActivity().overridePendingTransition(0, 0); } } private class mQueryLoadListener implements ParseRecyclerQueryAdapter.OnQueryLoadListener<ParseWallpaper>{ @Override public void onLoaded(List<ParseWallpaper> objects, Exception e) { Log.d(TAG, "onLoaded "+objects.size()); if (e == null) { if (objects.size() == 0){ showNoResultText(); } else { hideProgressLoader(); } } if (isAdded() && mSwipeLayout.isRefreshing()){ mSwipeLayout.setRefreshing(false); adapter.notifyDataSetChanged(); } } @Override public void onLoading() { Log.d(TAG, "onLoading "); } } private class mSwipeRefreshListener implements SwipeRefreshLayout.OnRefreshListener{ @Override public void onRefresh() { adapter.loadObjects(); } } /*private ParseQueryAdapter.QueryFactory<ParseWallpaper> getParseFactory(){ return new ParseQueryAdapter.QueryFactory<ParseWallpaper😠) { @Override public ParseQuery<ParseWallpaper> create() { ParseQuery<ParseWallpaper> query = ParseWallpaper.getQuery(); query.addDescendingOrder("createdAt"); query.whereEqualTo("isVisible",true); ParseQuery<ParseCategory> innerQuery = ParseCategory.getQuery(); if (objectId != null) { innerQuery.whereEqualTo("objectId", objectId); } else { innerQuery.whereEqualTo("isVisible",true); } query.whereMatchesQuery("category",innerQuery); return query; } }; }*/ private AppBarLayout.OnOffsetChangedListener mAppBarLayoutListener = new AppBarLayout.OnOffsetChangedListener() { @Override public void onOffsetChanged(AppBarLayout appBarLayout, int i) { mSwipeLayout.setEnabled(i == 0); } }; @Override public void onResume() { super.onResume(); mAppBarLayout.addOnOffsetChangedListener(mAppBarLayoutListener); } @Override public void onPause() { super.onPause(); mAppBarLayout.removeOnOffsetChangedListener(mAppBarLayoutListener); } } this is what I did in a fragment that has the grid adapter in it before was working correctly now not

package com.Kalimat.Khalidah.fragments; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; import com.Kalimat.Khalidah.AppController; import com.Kalimat.Khalidah.Config; import com.Kalimat.Khalidah.Constant; import com.Kalimat.Khalidah.R; import com.Kalimat.Khalidah.SpacesItemDecoration; import com.Kalimat.Khalidah.activity.DetailsActivity; import com.Kalimat.Khalidah.adapter.ParseGridAdapter; import com.Kalimat.Khalidah.adapter.ParseRecyclerQueryAdapter; import com.Kalimat.Khalidah.interfaces.Parse; import com.Kalimat.Khalidah.model.ParseWallpaper; import com.Kalimat.Khalidah.utils.DeviceUtils; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; public class RecentFragment extends Fragment { public final static String TAG = RecentFragment.class.getSimpleName(); private ParseGridAdapter adapter; private String objectId; private static final String KEY_OBJECT_ID = "OBJECT_ID"; private AppBarLayout mAppBarLayout; private DeviceUtils mDevideUtils; public static RecentFragment newInstance(String objectId) { Bundle args = new Bundle(); args.putString(KEY_OBJECT_ID, objectId); RecentFragment fragment = new RecentFragment(); fragment.setArguments(args); return fragment; } @Bind(R.id.swipeLayout) SwipeRefreshLayout mSwipeLayout; @Bind(R.id.recentContainer) RecyclerView mRecyclerView; @Bind(R.id.recentProgress) ProgressBar mProgressLoader; @Bind(R.id.recentNoResult) TextView mNoResultText; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_recent,container,false); ButterKnife.bind(this, rootView); mAppBarLayout = (AppBarLayout) getActivity().findViewById(R.id.app_bar); mAppBarLayout.addOnOffsetChangedListener(mAppBarLayoutListener); objectId = getArguments().getString(KEY_OBJECT_ID); mDevideUtils = AppController.getInstance().getUtils().getDeviceUtils(); //mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), Config.GRID_COLUMNS)); mProgressLoader.setVisibility(View.VISIBLE); mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)); adapter = new ParseGridAdapter(ParseWallpaper.getRecentQueryFactory(objectId), false,getActivity(),ParseGridAdapter.TYPE_RECENT); adapter.addOnQueryLoadListener(new mQueryLoadListener()); adapter.setOnGridItemClickListener(new mGridItemClickListener()); mRecyclerView.getRecycledViewPool().setMaxRecycledViews(0, 2 * Config.GRID_COLUMNS); SpacesItemDecoration decoration = new SpacesItemDecoration(0); mRecyclerView.addItemDecoration(decoration); mRecyclerView.setAdapter(adapter); setupSwipeRefresh(); return rootView; } private void setupSwipeRefresh(){ mSwipeLayout.setOnRefreshListener(new mSwipeRefreshListener()); mSwipeLayout.setColorSchemeResources(Config.SWIPE_REFRESH_COLORS); } private void showNoResultText(){ if(isAdded()){ mProgressLoader.setVisibility(View.GONE); mNoResultText.setVisibility(View.VISIBLE); } } private void hideProgressLoader(){ if (isAdded()){ mProgressLoader.setVisibility(View.GONE); } }

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта