Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

another fragment shows full screen #34

Closed
droidwithme opened this issue May 25, 2015 · 11 comments
Closed

another fragment shows full screen #34

droidwithme opened this issue May 25, 2015 · 11 comments

Comments

@droidwithme
Copy link

not able to use a fragment that contains listview. if i add the listview it looks in whole screen. the effect that is on another fragments not getting in listview.

@florent37
Copy link
Owner

I removed the ListView in the last version, can you please try with RecyclerView and tell me if you have the same issue ?

@droidwithme
Copy link
Author

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 notifications@github.com
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)
.

@droidwithme
Copy link
Author

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 droidwithme@gmail.com
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 <
notifications@github.com> 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)
.

@droidwithme
Copy link
Author

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 droidwithme@gmail.com
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 droidwithme@gmail.com
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 <
notifications@github.com> 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)
.

@droidwithme
Copy link
Author

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 droidwithme@gmail.com
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 droidwithme@gmail.com
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 droidwithme@gmail.com
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 <
notifications@github.com> 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)
.

@florent37
Copy link
Owner

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

@droidwithme
Copy link
Author

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 notifications@github.com
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)
.

@droidwithme
Copy link
Author

Why don't you let users add*
Sorry typo.

On Tue, May 26, 2015, 00:32 Devendra Singh droidwithme@gmail.com 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 notifications@github.com
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)
.

@florent37
Copy link
Owner

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

@droidwithme
Copy link
Author

Alright thanks.

On Tue, May 26, 2015, 14:52 Florent CHAMPIGNY notifications@github.com
wrote:

Closed #34 #34.


Reply to this email directly or view it on GitHub
#34 (comment)
.

@softmarshmallow
Copy link

can you give us example code? for using ObservableScrollView

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants