Comments (6)
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.
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.
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.
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.
Awesome!
Following your last instructions I could style my application without any problems:
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.
Thanks for the translations! I will take a look at that pull request as soon as I can.
from pulltorefresharp.
Related Issues (17)
- Objects on scrollview intercept touch events, pull to refresh doesn't work in that case HOT 1
- PullToRefresh intercepts drag from fast scrolling thumb HOT 6
- Binary XML file line #1: Error inflating class pulltorefresharp.android.views.ViewWrapper HOT 5
- Long touches not registering when Listview is at top scrollposition HOT 3
- ItemClick event not firing in ListView with custom adapter
- Crash - with list is in startup view and touching screen upon startup HOT 1
- Problem using pulltorefresharp HOT 3
- Linker Problem HOT 2
- Header Background Color
- Mono.Android.Support.V4 reference vs Xamarin.Android.Support.V4? HOT 3
- Empty view not supported
- Custom ListView
- Clarify licensing terms HOT 1
- about the content view's height
- Event touch not handled with added views
- How to apply translation for different language?
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 pulltorefresharp.