Page 4 of 10

Re: Bulk buy/sell/drop interface collaboration

Posted: Tue Jul 05, 2011 8:51 pm
by Samuel
ejwessel wrote:
Samuel wrote: Could you provide an apk, or the source code?
Then we can give feedback better. A screenshot can't say anything about behaviour.
could, but I dont think its ready just yet, I have a couple things left to do before I'd like to test it out amongst the users. I only recently got back to this, this weekend. I'll let you all know.
Sounds good. Looking forward for it.

Re: Bulk buy/sell/drop interface collaboration

Posted: Tue Jul 05, 2011 9:00 pm
by lady black
The interface looks good, a cancel button is probably a good idea.
On buying bonemeal potions and other 10-at-a-time items: just hit the back button to leave the shop and tap the priest again to go back to the shop-entering conversation, and buy 10 more. They are there again; please do not change them to restore at one per minute. I find it only slightly tedious to enter, buy, leave, enter, buy, leave, enter, ----. Certainly not bad enough that changing it would make our lives 10 times easier. (And as I carry a stock of 1000 bonemeal potions, I have done a lot of this.) With the new interface, it may get more annoying because the actual buying process will be so simplified for large numbers. But things like meat are only available 5 at a time, remember.

Re: Bulk buy/sell/drop interface collaboration

Posted: Wed Jul 06, 2011 2:54 am
by ejwessel
What's a good way to post my source up for you guys to look at?

I encountered a problem and honestly don't know whats wrong... I'd love help on possibly debugging it =)

Re: Bulk buy/sell/drop interface collaboration

Posted: Wed Jul 06, 2011 11:38 am
by Samuel
Did you try to zip the whole project and upload it to your post?
Or try some online service like: http://www.file-upload.net/

Re: Bulk buy/sell/drop interface collaboration

Posted: Wed Jul 06, 2011 7:07 pm
by ejwessel
Wasn't aware you could put zips up.

Here are the files. The errors I get are:

Code: Select all

07-06 11:47:52.560: ERROR/AndroidRuntime(10051): java.lang.NullPointerException
07-06 11:47:52.560: ERROR/AndroidRuntime(10051):     at com.PlayingAround.BulkSelectionInterface.<init>(BulkSelectionInterface.java:86)
however if I comment out line 86 then

then the error moves down to every .onClickListener function for any of the buttons that I have

I'm probably just missing something small. Anyways let me know

Re: Bulk buy/sell/drop interface collaboration

Posted: Wed Jul 06, 2011 11:26 pm
by Samuel
This doesn't work:

Code: Select all

		slider = (SeekBar)findViewById(R.id.slider);
		decrementButton = (Button)findViewById(R.id.decrement_button);
		incrementButton = (Button)findViewById(R.id.increment_button);
		finalizeButton = (Button)findViewById(R.id.finalize_button);
		cancelButton = (Button)findViewById(R.id.cancel_button);
		amountTaken = (EditText)findViewById(R.id.amount_taken);
		amountWitheld = (TextView)findViewById(R.id.amount_witheld);
All your controls are not initialized. They are null.
This results in the errors. However I could not find a bugfix.

Re: Bulk buy/sell/drop interface collaboration

Posted: Wed Jul 06, 2011 11:53 pm
by ejwessel
Samuel wrote:This doesn't work:

Code: Select all

slider = (SeekBar)findViewById(R.id.slider);
decrementButton = (Button)findViewById(R.id.decrement_button);
incrementButton = (Button)findViewById(R.id.increment_button);
finalizeButton = (Button)findViewById(R.id.finalize_button);
cancelButton = (Button)findViewById(R.id.cancel_button);
amountTaken = (EditText)findViewById(R.id.amount_taken);
amountWitheld = (TextView)findViewById(R.id.amount_witheld);
All your controls are not initialized. They are null.
This results in the errors. However I could not find a bugfix.
Yeah, this is what I suspected... But its weird since, this is the way to initialize the buttons from the xml

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 12:11 am
by ejwessel
OHHH Here's what happened...

I was initializing all of my variables and objects before I told it to set up the content view
this caused it to read from a file it was not currently looking at and therefore the nullpointerexception
In essence I simply fixed it by doing

Code: Select all

		setContentView(R.layout.custom_layout_buy); //THIS COMES FIRST NOT AFTER
		
		//initialize variables
		typeOfInterface = interfaceType;
		item = itemType;
		slider = (SeekBar)findViewById(R.id.slider);
		decrementButton = (Button)findViewById(R.id.decrement_button);
		incrementButton = (Button)findViewById(R.id.increment_button);
		finalizeButton = (Button)findViewById(R.id.finalize_button);
		cancelButton = (Button)findViewById(R.id.cancel_button);
		amountTaken = (EditText)findViewById(R.id.amount_taken);
		amountWitheld = (TextView)findViewById(R.id.amount_witheld);
Thanks so much Samuel, you saved it! =D

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 6:54 am
by ejwessel
Here's and apk to play around with. Let me know what you think

I currently have the dialog set up for selling 10 items of meat

Note: anything to deal with the slider either does not work or does not work correctly
Also note that as for the amount you're selling is currently being worked on as I'm finding a place to put it.

Yes I do know it says "press the button to buy something" when it should be sell, thats unimportant =P

Re: Bulk buy/sell/drop interface collaboration

Posted: Thu Jul 07, 2011 5:25 pm
by qasur
Can it be setup so items you only have one of in inventory/store don't invoke the slider?