Is it possible to extend built in ViewManagers? - android

I would like to create a new UI component in react-native, with an underlying RecyclerView using a custom layout manager, but creating one from scratch would mean giving up things like these: https://facebook.github.io/react-native/docs/refreshcontrol.html
Is there a way to 'extend' from the built in view managers, so I can keep the core functionality of ListView intact, and get what I want just by overriding the layout manager?
Also, I checked the react-native source and couldn't really find the view manager for the built in ListView, maybe I'm overlooking something and looking in the wrong place?

Related

When you use Android Studio are you working with MVC?

I know in Xcode when you write an app, you have controller, model, views.
android studio doesn't have a Controller specific. Do you think in android studio are working with MVC?
No but you can build it quite easily:
On Android, you always have these XML which represent the views (actually you can do all programatically but a better practice will invite you to use these XML because they're more flexible) and they're in the ressources. The problem comes when you do custom views because you need to put a bit of logic in that and then it is part of your java code.
Then the controller is, basically, the activity but the fragments contain also, theoretically a bit of logic so they're like hybrid between controller and view (I, personally, consider them as controller but my pair developer as a view).
Then the models are very easy to separate... At the end you can get something like this: (but I do not if you would call it MVC)
-java
|_model
|_user.java
|_view
|_customView.java (extends View for example)
|_controller
|_MainActivity.java
|_fragment_contained_in_main_activity_inflating_Custom_View.java
-res
|_layout
|_customView_layout.xml
Android the activity or fragment is the "controller". You write the controlling code in java and the views in XML. You can make model classes as .java files and when populating data from a server wrap those model classes in an Array or List to be used and placed onto your view via the activity code.

Is it possible to show dummy text for Views in the IDEA Android UI designer?

I've recently switched from eclipse to IntelliJ IDEA for Android development. I'm not missing any features, beside the rather helpful designer preview in eclipse. I populate certain views in my activities at runtime, there are no texts defined in the corresponding XML files. In eclipse, it looks like this:
It fills the empty views with placeholder text which is nice to get a rough impression of the layout without having to start the app. But in IDEA, the designer looks like this:
The views are empty, and it's difficult to even see them without selecting them in the Component Tree. I haven't found anything in the options, is this missing from IDEA or did I miss an option?
It's not possible right now, but it would be nice to have, I've created a new feature request, please vote.

How to create an info overlay in Android

I am looking for a way to create a short overlay intro of an app to display to first time users. These posts gave me some understanding of how it can be done, but not entirely:
How do I create a help overlay like you see in a few Android apps and ICS?
How to use LayoutInflater / ViewStub for an overlay
I do not understand how to access my elements correctly, since my root layout element is a LinearLayout that includes an Actionbar and a ViewPager instead of containing actual elements.
Are there any frameworks that does this for you?
I think that this library : ShowcaseView is your best option.
As its name implies, it allows you to recreate the Android 4.x showcase view; ie :
.
The documentation of the project explains how to implement it.
Word of advice though : this kind of explanation view is viewed as bad design most of the time : if your application is well designed, you don't need to provide a tutorial to the user, it is supposed to be intuitive.
It can be totally justified in some cases of course, just be sure that :
-your users really need a tutorial.
-it is not because you are doing something opposite to the Android convetions.
Have a look at MaterialShowcaseView. It inherits from ShowcaseView and is up-to-date.

MonoDroid custom control + populate listview programmatically

i am pretty new to all this Monodroid stuff.
I am porting my Windows Phone Applications over to Android, so far so good as far as recreating the AXML UI but when trying to port my custom usercontrol, that inherit from the UserControl class, i can't seem to figure out how to do it.
Could someone give me a small example?
What i actually want to do is to create a custom reusable control that have a simple colored rectangle on the left and some text on its right.
I want to be able to populate a listview(don't know how to do that one either) by instanciating the control as many times as i need it.
I have no clue how to create the control itself and instanciate it to fill the listview programmatically.
Thanks in advance!
I would recommend reading through this set of tutorials on Xamarin's site for an introduction to how lists work in Android. Rather than using a custom "control", it sounds like all you really want is a custom row layout, which is covered in Part 3.

how can I implement "boundary feedback" on android?

'Android Design' site is recommending 'Boundary feedback' for scrollable view.
http://developer.android.com/design/style/touch-feedback.html
http://i.stack.imgur.com/TuBkX.png
is there any API or library for custom view to implement that with ease and consistent?
or should I implement it from the scratch?
Are you "building custom"? If you stick to the UI elements form the API you should be fine. All the scroll views can already be configured to do different things for boundry cases (such as overscroll).
If you are building UI elements from scratch, you might consider simply overriding or subclassing existing UI elements to function the way you want. If not, you can examine the source to see how different boundry cases (again overscrolling) are implemented. But, I get the feeling you're in the first category..

Categories

Resources