Comments (11)
I removed the ListView in the last version, can you please try with RecyclerView and tell me if you have the same issue ?
from materialviewpager.
It will be better if you add some dummy data, empty view instead.
I dont have idea where i can set data on my different views that are in
recyclerview xml.
it will take just some minutes please add some dummy data, let say one
images to and a textview.
Thanks a lot.
On Mon, May 25, 2015 at 4:04 PM Florent CHAMPIGNY [email protected]
wrote:
I removed the ListView in the last version, can you please try with
RecyclerView and tell me if you have the same issue ?—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
and let developers to add their views it will be used widely if you add
another views instead single recyclerview.
coz in all fragments there will less possibility to use recycler views they
can use custom views.
On Mon, May 25, 2015 at 4:22 PM Devendra Singh [email protected]
wrote:
It will be better if you add some dummy data, empty view instead.
I dont have idea where i can set data on my different views that are in
recyclerview xml.
it will take just some minutes please add some dummy data, let say one
images to and a textview.
Thanks a lot.On Mon, May 25, 2015 at 4:04 PM Florent CHAMPIGNY <
[email protected]> wrote:I removed the ListView in the last version, can you please try with
RecyclerView and tell me if you have the same issue ?—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
if you have less time you just give an idea how we can customize it even
that will be beneficial for us. or write on "how to use"
On Mon, May 25, 2015 at 4:24 PM Devendra Singh [email protected]
wrote:
and let developers to add their views it will be used widely if you add
another views instead single recyclerview.
coz in all fragments there will less possibility to use recycler views
they can use custom views.On Mon, May 25, 2015 at 4:22 PM Devendra Singh [email protected]
wrote:It will be better if you add some dummy data, empty view instead.
I dont have idea where i can set data on my different views that are in
recyclerview xml.
it will take just some minutes please add some dummy data, let say one
images to and a textview.
Thanks a lot.On Mon, May 25, 2015 at 4:04 PM Florent CHAMPIGNY <
[email protected]> wrote:I removed the ListView in the last version, can you please try with
RecyclerView and tell me if you have the same issue ?—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
hey there,
Now im attaching the snapshots here.
and the code i m writing to add content to RV.
ADAPTER CLASS:
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
private ItemData[] itemsData;
public MyAdapter(ItemData[] itemsData) {
this.itemsData = itemsData;
}
// Create new views (invoked by the layout manager)
@Override
public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
int viewType) {
// create a new view
View itemLayoutView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.list_item_card_big, null);
// create ViewHolder
ViewHolder viewHolder = new ViewHolder(itemLayoutView);
return viewHolder;
}
// Replace the contents of a view (invoked by the layout manager)
@Override
public void onBindViewHolder(ViewHolder viewHolder, int position) {
viewHolder.txtViewTitle.setText(itemsData[position].getTitle());
viewHolder.imgViewIcon.setImageResource(itemsData[position].getImageUrl());
}
// inner class to hold a reference to each item of RecyclerView
public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView txtViewTitle;
public ImageView imgViewIcon;
public ViewHolder(View itemLayoutView) {
super(itemLayoutView);
txtViewTitle = (TextView)
itemLayoutView.findViewById(R.id.brandtitle);
imgViewIcon = (ImageView) itemLayoutView.findViewById(R.id.img);
}
}
// Return the size of your itemsData (invoked by the layout manager)
@OverRide
public int getItemCount() {
return itemsData.length;
}
}
MODELCLASS:
public class ItemData {
private String title;
private int imageUrl;
public void setTitle(String title) {
this.title = title;
}
public void setImageUrl(int imageUrl) {
this.imageUrl = imageUrl;
}
public ItemData(String title,int imageUrl){
this.title = title;
this.imageUrl = imageUrl;
}
public String getTitle() {
return title;
}
public int getImageUrl() {
return imageUrl;
}
// getters & setters
}
and MAIN.JAVA
public class TwentyOffers extends Fragment {
private static final String url = "http://abc";
private RecyclerView mRecyclerView;
private RecyclerView.Adapter OffersAdapter;
Context context;
//List<BrandList> mContentItems= new ArrayList<BrandList>();
private ProgressDialog pbDialog;
public static TwentyOffers newInstance() {
return new TwentyOffers();
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_scroll, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle
savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
RecyclerView recyclerView =
(RecyclerView)view.findViewById(R.id.recyclerView);
// this is data fro recycler view
ItemData itemsData[] = { new ItemData("Help",R.drawable.flying),
new ItemData("Delete",R.drawable.flying),
new ItemData("Cloud",R.drawable.flying),
new ItemData("Favorite",R.drawable.flying),
new ItemData("Like",R.drawable.flying),
new ItemData("Rating",R.drawable.flying)};
// 2. set layoutManger
recyclerView.setLayoutManager(new
LinearLayoutManager(getActivity()));
// 3. create an adapter
MyAdapter mAdapter = new MyAdapter(itemsData);
// 4. set adapter
recyclerView.setAdapter(mAdapter);
// 5. set item animator to DefaultAnimator
recyclerView.setItemAnimator(new DefaultItemAnimator());
}
Please look into this and fix it asap.
as my client forcing me to complete his app.
and personally thank you so much for developing the library.
Looking forward to here.
Thanks & Regards,
Devendra Singh
Mumbai.
On Mon, May 25, 2015 at 4:26 PM Devendra Singh [email protected]
wrote:
if you have less time you just give an idea how we can customize it even
that will be beneficial for us. or write on "how to use"On Mon, May 25, 2015 at 4:24 PM Devendra Singh [email protected]
wrote:and let developers to add their views it will be used widely if you add
another views instead single recyclerview.
coz in all fragments there will less possibility to use recycler views
they can use custom views.On Mon, May 25, 2015 at 4:22 PM Devendra Singh [email protected]
wrote:It will be better if you add some dummy data, empty view instead.
I dont have idea where i can set data on my different views that are in
recyclerview xml.
it will take just some minutes please add some dummy data, let say one
images to and a textview.
Thanks a lot.On Mon, May 25, 2015 at 4:04 PM Florent CHAMPIGNY <
[email protected]> wrote:I removed the ListView in the last version, can you please try with
RecyclerView and tell me if you have the same issue ?—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
Hi, I looked at your code, you forgot 2 importants lines with the adapter, you did
// 3. create an adapter
MyAdapter mAdapter = new MyAdapter(itemsData);
// 4. set adapter
recyclerView.setAdapter(mAdapter);
But you have to embed your adapter into my RecyclerViewMaterialAdapter, this will add a empty view on top of the recyclerview
// 3. create an adapter
MyAdapter mAdapter = new MyAdapter(itemsData);
RecyclerViewMaterialAdapter mAdapterMaterial = new RecyclerViewMaterialAdapter(mAdapter);
// 4. set adapter
recyclerView.setAdapter(mAdapterMaterial);
//5. Register the recyclerview to MaterialViewPager
MaterialViewPagerHelper.registerRecyclerView(getActivity(), recyclerView, null);
as said in the Readme#RecyclerView
https://github.com/florent37/MaterialViewPager#recyclerview
for your first question, I allow user to use RecyclerView & ScrollView, so I think they can create all design they want with it. I removed ListView because I can't get a perfect scroll listener, pixel per pixel with ListView
from materialviewpager.
Aah!
Well I will try as you said. Bt see why don't you add users any view like
scroll view and may be list view.
Even I will ask for an another issue tomorrow.
I'm off from work.
Till than you can have a look on retailmenot app's homepage listview.
Not asking to develop module BT give some idea.
How can we get this?
Or can we decode this apk to get the code only of listview.?
And thanks again.
On Tue, May 26, 2015, 00:23 Florent CHAMPIGNY [email protected]
wrote:
Hi, I looked at your code, you forgot 2 importants lines with the adapter,
you did// 3. create an adapter MyAdapter mAdapter = new MyAdapter(itemsData); // 4. set adapter recyclerView.setAdapter(mAdapter);
But you have to embed your adapter into my RecyclerViewMaterialAdapter,
this will add a empty view on top of the recyclerview// 3. create an adapter MyAdapter mAdapter = new MyAdapter(itemsData); RecyclerViewMaterialAdapter mAdapterMaterial = new RecyclerViewMaterialAdapter(mAdapter); // 4. set adapter recyclerView.setAdapter(mAdapterMaterial); //5. Register the recyclerview to MaterialViewPager MaterialViewPagerHelper.registerRecyclerView(getActivity(), recyclerView, null);
as said in the Readme#RecyclerView
https://github.com/florent37/MaterialViewPager#recyclerview
for your first question, I allow user to use RecyclerView & ScrollView, so
I think they can create all design they want with it. I removed ListView
because I can't get a perfect scroll listener, pixel per pixel with ListView—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
Why don't you let users add*
Sorry typo.
On Tue, May 26, 2015, 00:32 Devendra Singh [email protected] wrote:
Aah!
Well I will try as you said. Bt see why don't you add users any view like
scroll view and may be list view.Even I will ask for an another issue tomorrow.
I'm off from work.
Till than you can have a look on retailmenot app's homepage listview.
Not asking to develop module BT give some idea.
How can we get this?
Or can we decode this apk to get the code only of listview.?
And thanks again.On Tue, May 26, 2015, 00:23 Florent CHAMPIGNY [email protected]
wrote:Hi, I looked at your code, you forgot 2 importants lines with the
adapter, you did// 3. create an adapter MyAdapter mAdapter = new MyAdapter(itemsData); // 4. set adapter recyclerView.setAdapter(mAdapter);
But you have to embed your adapter into my RecyclerViewMaterialAdapter,
this will add a empty view on top of the recyclerview// 3. create an adapter MyAdapter mAdapter = new MyAdapter(itemsData); RecyclerViewMaterialAdapter mAdapterMaterial = new RecyclerViewMaterialAdapter(mAdapter); // 4. set adapter recyclerView.setAdapter(mAdapterMaterial); //5. Register the recyclerview to MaterialViewPager MaterialViewPagerHelper.registerRecyclerView(getActivity(), recyclerView, null);
as said in the Readme#RecyclerView
https://github.com/florent37/MaterialViewPager#recyclerview
for your first question, I allow user to use RecyclerView & ScrollView,
so I think they can create all design they want with it. I removed ListView
because I can't get a perfect scroll listener, pixel per pixel with ListView—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
You can add ScrollView, with ObservableScrollView, because I need to get the Scroll Offset.
And as I said before, I removed ListView because the scroll listener is not as accurate as RecyclerView's one
from materialviewpager.
Alright thanks.
On Tue, May 26, 2015, 14:52 Florent CHAMPIGNY [email protected]
wrote:
—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from materialviewpager.
can you give us example code? for using ObservableScrollView
from materialviewpager.
Related Issues (20)
- How to set my adapter to the fragment?
- I read almost all the issues but still unable to resolve this issue of Scroll layout HOT 2
- Help Me: Black screen? HOT 1
- customView in header
- Failed to resolve: recyclerview-v7
- Failed to open it HOT 3
- ava.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN HOT 11
- How add a custom toolbar?
- Can I change the viewpager_animatedHeaderImage flag on code? HOT 1
- ScrollToPosition issue!
- How to insert Item On RecycleView?
- Does it still work with Android Jetpack ?
- Can I use without viepager only frame?
- Issue with scrolling - when recyclerview horizontally LinearLayoutManager.HORIZONTAL
- Crashes of Android Pie HOT 1
- change Header Logo HOT 1
- java.lang.NullPointerException
- Header image
- how can use other layout like linear layout instead using recyclerview
- Doesn't show tab title or PagerSlidingTitleStrip on Android 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialviewpager.