view

Android listView null pointer exception

Hello everyone, I need a small help in List view. I am generating a list View, but whenever i do getChildAt(int position) it throws null pointer exception. Here is the code _list=(ListView)findViewById(android.R.id.list); _loadListElements(); _showListUI(); _list.getChildAt(1).setBackgroundColor(Color.WHITE); ...

Performance problem in view framework in Grails

Hi I run some test to keep track of response time of a grails app. I use the layout-view framework of grails in this way: In a controller I determine what view and layout to use Then I render a genericView with a code like this: So this genericView do all the magic. I create a Performance filter that track how much time takes b...

Measuring text height to be drawn on Canvas ( Android )

Any straight forward way to measure the height of text? The way I am doing it now is by using Paint's measureText() to get the width, then by trial and error finding a value to get an approximate height. I've also been messing around with FontMetrics, but all these seem like approximate methods that suck. I am trying to scale things for...

Android: View multiple image with system image viewer

We can view an image with code: Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File("/sdcard/test.jpg"); intent.setDataAndType(Uri.fromFile(file), "image/*"); startActivity(intent); What if we have some images? How can we put the extras to let the viewer know we have /sdcard/a...

Is it possible to somehow "bind' the dimensions of a ShapeDrawable to that of a View?

Specifically, I'd like to bind the height of a custom thumb for a SeekBar to the height of the SeekBar. Thanks! ...

Identify the View that triggered a touch-event

Hi, I am trying to drag a view over the screen FrameLayout main = (FrameLayout) findViewById(R.id.main_view); final Ball bigball; bigball = new Ball(this,50,50,25, 0xFFFF0000); main.addView(bigball); This draws a red circle on my screen. How and where do I need to implement my touchscreen-handling, if I want it only to trigger if som...

How do i get the point/coordinate the user clicked on an android view?

Hi, I have an imageview and when clicked, calls OnClickListener.onClick(View v). How do I get the exact point/coordinate that the user clicked? Thanks ...

Interface design

A client of mine asked for a basic version of an iPhone application to work with, and has been happily using it for 2 months now. Now he wants me to implement the full version but I'm having trouble finding a good interface to make it both visually attractive and practical in use: I should use a completely different tab-bar at the botto...

iPhone MVC. Problems with the model.

I'm new to programming, iphone application programming in specific. After reading a bunch about MVC I decided to give it a try in a small application. As to my understanding, MVC works like this: Model: data, manipulating data, retrieving data. ViewController: formats data from the model (NSDate to specific style), etc. View: the actu...

Android inflated view is empty

I am trying to add a divider between entries in a vertical LinearLayout, to emulate the appearance of a ListView. (I can't just use a ListView in this particular situation.) This is what I have in list_divider.xml: <?xml version="1.0" encoding="utf-8"?> <View xmlns:android="http://schemas.android.com/apk/res/android" android:backgr...

UIView iPad orientation weirdness

When I receive a UIDeviceOrientationDidChangeNotification how do I tell if it's a portrait/landscape change or a face up/face down change? I also receive notifications in between landscape/portrait changes such as when the device goes 45 degrees between landscape & portrait. I only care about changes from full 90 landscape/portrait chan...

ASP.NET MVC: Including MVC partial view in APS.NET Forms pages

We've got old ASP.NET Forms pages and new MVC views and partials views in the same solution. Some pages on the site are MVC, and legacy pages are Forms. One of these legacy Forms pages is an .ascx control. Is there any way for me to insert an MVC partial view (.ascx) into this Forms .ascx control? ...

Reseting the background color of a View

I'm trying to restore the background Color of a View. I have several selectable Views. When the user clicks one of those Views, the following code is executed and the View becomes Yellow: View newSelection, previousSelection; ... if(previousSelection != null) { previousSelection.setBackgroundColor(Color.BLACK); // problem here } ...

Android: addView and layout method does not work together.

In Android when I am adding a view object like ImageView to FrameLayout view and then immediately trying to call layout() method to repositioned the added view object it is not working. But when I call the layout method alone after some new event e.g. touch event then layout() seems to work. This also happens when bringToFront() and layo...

Android views as templates

Hi, I want to create an android Layout of which I want to instantiate several copies. I understand that declaring the layout in an XML will create a single instance. Is there a way to use the XML View declaration as a 'definition' rather than a 'declaration' ? Or is it possible to clone a view ? Thanks; ...

Detect When Return to a View

HI How can I detect when I return to a view? I have an iPad app in development and I want to do something upon returning to a certain view. How can I do this? Thanks. ...

Manual call to onListItemCLick

I am using a ListView with a SimpleAdapter. Once data is populated into it I would like to set the first item in the list. This can be done by clicking on the list item on the screen. I want to just call the method directly after I populate the list so that when you see the UI its already done. My only problem is getting the View fro...

iPad Split View "Zoom Down" Table View

Hello! I am trying to get a good idea of a good way to add items to a split view for iPad. My idea was where you tap the plus button and the table view scrolls down (quickly) to below the table that is there to a screen where you can enter in the new stuff. Then when you click done it zooms back up to the main table. Is this possible a...

Drupal Create Dynamic Menu with an Active Trail Property

Hi there, I want to create a dynamic menu that will get it's items from a certain node type. I thought I could do this by creating a view of the titles and putting it in a block. However, when someone clicks on one of these titles I want to highlight it, and so want a way of adding an active class to the link. I know Drupal does this au...

Are there any 3rd party UI libraries for Android?

I've seen specialized Android UI libraries like for charting, but none for alternate implementations of controls and containers. Are there any? ...