Coder Social home page Coder Social logo

Comments (6)

bduncavage avatar bduncavage commented on August 11, 2024

It sounds like the Getting Started doc could use some more detail.

One thing to clarify could be how to use the IPullToRefresharpView from FindViewById. It sounds like you were trying to assign a variable of type ListView to IPullToRefresharpView, which won't work. The intended use is to have a variable of type IPullToRefresharpView (not ListView or GridView etc) that you use solely for PullToRefresharp communication to the view.

However, you can get a reference as the PullToRefresharp widget type, as you mention in your comment.

I will update the Getting Started docs to mention this, and fix the incorrect canonical naming of ViewWrapper and ListView in the layout example of Getting Started as well.

Thanks for bringing this up, and remember, when in doubt (from the docs), look at the sample project to verify correct usage (I will definitely try to keep the docs as accurate as possible though :)

Thanks!

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

Please see the latest version of README.md and let me know if that clarifies things, and would've saved you some headache :)

The README.md is just a duplicate of the Getting Started doc that ships with the Xamarin component, I will update it in the next version of the component.

from pulltorefresharp.

georgepiva avatar georgepiva commented on August 11, 2024

Cool! Thanks for updating the README.md file.
Just some more points:

var myPullToRefresharpView = FindViewById<IPullToRefresharpView>(Resource.Id.myListView);

The above line still generating the next error at compiling time:

Error CS0311: The type `PullToRefresharp.Android.Views.IPullToRefresharpView' cannot be used as type parameter `T' in the generic type or method `Android.App.Activity.FindViewById<T>(int)'. There is no implicit reference conversion from `PullToRefresharp.Android.Views.IPullToRefresharpView' to `Android.Views.View' (CS0311)

Am I missing something? But as I am using the alternative way, I am able to use the component.

Other interesting thing would be to have a wiki page explaining how developers could customize the component inside their applications.

For instance, my current application must support the Pt-BR (Portuguese - Brazil) language and so I would like to translate current component messages using my project's resources\values\strings.xml file:

...
<string name="ReleaseToRefresh_">Soltar para atualizar...</string> 
<string name="PullDownToRefresh_">Arrastar para baixo para atualizar...</string> 
<string name="Loading_">Carregando...</string> 
...

As I didn't see any string customization in the Sample provided, it would be nice to have it documented in the wiki.

Thank you for your help.

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

Doh, yeah, you're right, I'm sorry. You can't fetch the view directly with IPullToRefresharpView as the type, not sure what I was thinking (long week). You should fetch it as the PullToRefresharp widget type, will update readme again (i.e. the way you are doing it is the Right Way™).

You can customize the header with colors, views and localized strings, I just haven't written the docs yet :) Look in attrs.xml for available attributes you can supply to the wrapper view.

If you translate the text, feel free to submit the new strings and I'll add them as part of the component, thus slowly localizing it.

I am also planning on possibly making some header themes that ship with the library/component. But you can always override the stock header by providing your own in the layout, i.e:

<pulltorefresharp.android.views.ViewWrapper>
    <LinearLayout>
        <!-- your custom header -->
    </LinearLayout>
    <pulltorefresharp.android.widget.GridView />
</pulltorefresharp.android.views.ViewWrapper>

from pulltorefresharp.

georgepiva avatar georgepiva commented on August 11, 2024

Awesome!

Following your last instructions I could style my application without any problems:

pulltorefresh

If you would like to localize a little bit more the component, here comes a generated pull request: #4

I think it is now really easy for new developers to start using your component. You can now close this issue. Finally, thank you again for being providing us this project.

from pulltorefresharp.

bduncavage avatar bduncavage commented on August 11, 2024

Thanks for the translations! I will take a look at that pull request as soon as I can.

from pulltorefresharp.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.