Похожие чаты

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

3 ответов

9 просмотров

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); } }

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

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

Ясн. Но я всеравно к кедам отношусь с опасением. Чисто субьективное кедосозерцание. Что касаемо "восторга изяшности кед" так и не вкурил, хотя много слышал, пока не поставил с...
Артем Записной
30
Такой вопросец - есть функция function MySuperDuperConcat(const a: array of AnsiString): AnsiString; Как мне в её теле сделать вот так? Result:=Concat(a); А не грустный вариан...
notme
15
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
48
type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
They keep hyping $FUN but where's the progress? 🙄
Noah Noure
23
Btw guys very stupid question but i haven't researchd so js asking you pros . Can ltc be traced too? Literally point to pint to the user? And getting the banks blocked ? Exch...
20
А чем вам питонисты не угодили?😂
.
79
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
How can a minority hashrate chain defend from a fork-hopping ASIC miner? The problem: 1. A miner comes into your network, and mines at 60-70% hashrate. 2. After some time, th...
Kishniev
13
yeap, thanks guys for response, but I really like to understand does a pool created on curve.fi has the option or api or I can call a function of a smart contract to set excha...
Oleg Karoza
11
Карта сайта