Похожие чаты

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

3 ответов

17 просмотров

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

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

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

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
16
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
any reference of this implementation?
BitBuddha
29
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Карта сайта