How to make add/remove item in list view modify variables (int and double) in Android

I'll keep this short. I am creating an Android program to allow users to create test mech builds outside of a video game in order to determine if their build is possible in game before dropping money.

Currently, a user can click "add modules" to choose between a list of items in a dialog to populate the list view. Each mech is limited to certain variables. Such as weight, slots open, hard points, etc. Once your mech weighs so much for instance, the part cannot be added.

I am looking for a way to populate the list and change variables depending on the part chosen (I'm pretty sure a simple if/else statement will work here) and more importantly I am looking for a way to allow the user to click a list item and remove it from list along with removing the added change to the variables (weight, slots, etc). (example: Part A increases tonnage from 0/100 to 10/100 tons. User removes part A and tonnage drops to 0/100 again).

Thanks in advance!

Visual: Screenshot I do not have the rep to post images.

Answers


Need Your Help

Displaying a default image and changing it once the actual image finished loading

c# .net wpf bitmapimage markup-extensions

I have a WPF markup extension in charge of retrieving images by name, returning a BitmapImage object.

Check if an AS3 class is Interface

actionscript-3 class reflection interface

How can I determinate if my Class object is an Interface or not?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.