yashsingh1/xdaforums huggingface dataset:
[Java for Android App Development] nikwen:
Set the radius to 0, too. :)

---------- Post added at 07:36 PM ---------- Previous post was at 07:29 PM ----------

Ok. I have found a better way.

Set all variables to -1 instead and check whether they are bigger than 0 or equal.

If they are, draw the circle. If they are not, do not draw it. Got it?
[Java for Android App Development] darthvader45:
Is this what you mean?

case MotionEvent.ACTION_UP:
// finish the line, create an object of it and add it to the ArrayList

switch(drawType)
{
case LINE:
MyLine line1 = new MyLine(startX, startY, currentX, currentY, color);
shapeArray.add(line1);
break;
case CIRCLE:
MyCircle circle1 = new MyCircle(startX, startY,radius, color);
shapeArray.add(circle1);
startX=0;
startY=0;
currentX=0;
currentY=0;
radius=0;
break;
[Java for Android App Development] darthvader45:
Not sure how to do the check.
[Java for Android App Development] nikwen:
Use an if-clause like that:

if (startX >= 0) {

//commands for drawing

}
[Java for Android App Development] darthvader45:
Not quite doing it. I can rubber band it, but it snaps back to -1 and I lost the saving.

public boolean onTouchEvent(MotionEvent event)
{
// get the current X and Y position from the event
currentX = event.getX();
currentY = event.getY();

// switch on the touch event action
switch(event.getAction())
{
case MotionEvent.ACTION_DOWN:

// start the line
startX = currentX;
startY = currentY;
invalidate();
return true;
case MotionEvent.ACTION_UP:
// finish the line, create an object of it and add it to the ArrayList

switch(drawType)
{
case LINE:
MyLine line1 = new MyLine(startX, startY, currentX, currentY, color);
shapeArray.add(line1);
break;
case CIRCLE:
startX=-1;
startY=-1;

radius=-1;
if(startX >=0){
MyCircle circle1 = new MyCircle(startX, startY,radius, color);
shapeArray.add(circle1);
}
break;

case RECTANGLE:
MyRectangle rect1 = new MyRectangle(startX, startY, currentX, currentY, color);
shapeArray.add(rect1);
//Do the same for the rectangle
break;
}
invalidate();
return true;

case MotionEvent.ACTION_MOVE:
deltaX = currentX - startX;
deltaY = currentY - startY;
invalidate();

return true;
default:
return super.onTouchEvent(event);
}

}
[Java for Android App Development] nikwen:
Well, you need to add it after the saving. So that it is saved and afterwards set to -1. :)
[Java for Android App Development] darthvader45:
switch(drawType)
{
case LINE:
MyLine line1 = new MyLine(startX, startY, currentX, currentY, color);
shapeArray.add(line1);
break;
case CIRCLE:

if(startX >=0){
MyCircle circle1 = new MyCircle(startX, startY,radius, color);
shapeArray.add(circle1);
}
startX=-1;
startY=-1;

radius=-1;
break;

case RECTANGLE:
MyRectangle rect1 = new MyRectangle(startX, startY, currentX, currentY, color);
shapeArray.add(rect1);
//Do the same for the rectangle
break;
}
invalidate();
return true;
[Java for Android App Development] nikwen:
Does it work?
[Java for Android App Development] darthvader45:
Just checking...

Edit: It works, but one still draws at x:-1 y:-1

Edit2: I figured a workaround for the "double circles" effect I had originally. If I draw slowly, it doesn't create the doubles.

Edit3: Ok, how would I make it so that selecting an item in a submenu called Color would change the color of the shape?
[Java for Android App Development] nikwen:
Drawing slowly is no great solution. Wait. I will check this. ;)

EDIT: Please post your new code for that. :)
[Java for Android App Development] darthvader45:
Here's the code for the submenu

public boolean onOptionsItemSelected2(MenuItem item)
{
switch(item.getItemId()){
case R.id.submenu_red:
LineDrawView.paintFill.setColor(Color.RED);
break;
case R.id.submenu_cyan:
LineDrawView.paintFill.setColor(Color.CYAN);
break;
case R.id.submenu_green:
LineDrawView.paintFill.setColor(Color.GREEN);
}
return super.onOptionsItemSelected(item);
}
[Java for Android App Development] nikwen:
Ok. Remove the 2 in the method name. :)

I meant the complete code. ;)

To check what the error with the drawing was. :)
[Java for Android App Development] nikwen:
What is the exact error message?

Important: It will not work with the 2!

Have a look at this: http://developer.android.com/refere...#onOptionsItemSelected(android.view.MenuItem)
[Java for Android App Development] darthvader45:
"Duplicate method onOptionsItemSelected(MenuItem) in type MainActivity" is the error message. Maybe if I move this method to LineDrawView.java, I could be able to get it to work correctly.
[Java for Android App Development] nikwen:
That will compile but not work.

It needs to be in your Activity.

I guess I know why it cannot compile. Eclipse generates a default implementation of this method. Just remove the other method with this name.
[Java for Android App Development] darthvader45:
The other method sets the drawType, which allows me to draw different shapes.
[Java for Android App Development] nikwen:
Yes, maybe it does that but both have the same name. You cannot have two methods with the same name and the same arguments within one class. You cannot change the name and the arguments because Android needs it that way.

Post the code of both methods and I will help you to combine them to one method. :)
[Java for Android App Development] darthvader45:
Alright, this is what I have, should I put the other switch statement in the first method?:

public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId())
{
case R.id.line:
myView.setDrawType(1);
return true;
case R.id.circle:
myView.setDrawType(2);
return true;
case R.id.rectangle:
myView.setDrawType(3);
return true;
default:
return super.onOptionsItemSelected(item);
}

}

public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId()){
case R.id.submenu_red:
LineDrawView.paintFill.setColor(Color.RED);
break;
case R.id.submenu_cyan:
LineDrawView.paintFill.setColor(Color.CYAN);
break;
case R.id.submenu_green:
LineDrawView.paintFill.setColor(Color.GREEN);
}
return super.onOptionsItemSelected(item);
}
[Java for Android App Development] nikwen:
Just add the case statements to the first switch:

public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId())
{
case R.id.line:
myView.setDrawType(1);
return true;
case R.id.circle:
myView.setDrawType(2);
return true;
case R.id.rectangle:
myView.setDrawType(3);
return true;
case R.id.submenu_red:
LineDrawView.paintFill.setColor(Color.RED);
return true;
case R.id.submenu_cyan:
LineDrawView.paintFill.setColor(Color.CYAN);
return true;
case R.id.submenu_green:
LineDrawView.paintFill.setColor(Color.GREEN);
return true;
default:
return super.onOptionsItemSelected(item);
}

}
[Java for Android App Development] darthvader45:
Got that, gonna test my code.

Edit: Nope, the color's not changing.
[Java for Android App Development] nikwen:
Delete this line in the onDraw method:

paintFill.setColor(Color.BLACK);

It reverts any user setting.

Btw, please do not edit your posts for things like reporting whether it works. Create a second one which will be appended to the first one automatically but will be shown to me in the user control panel. ;)
[Java for Android App Development] darthvader45:
It works, but only for lines.

And it effects all lines, not just the one being drawn.
[Java for Android App Development] nikwen:
That is true. For circles and rectangles you use another Paint object called paintStroke:

canvas.drawCircle(circle.startX, circle.startY, circle.radius, [B]paintStroke[/B]);

Use paintFill there, too.

If you want to set the color for each line, you will have to add a new Field to your classes like this:

Color color;

Set the color of the object (the line, circle or rectangle) when you create the object (in the constructor).

Then when you draw the line, draw it in the color you have set:

if (l instanceof MyLine) {
MyLine line = (MyLine) l;
paintFill.setColor(line.color);
canvas.drawLine(line.startX, line.startY, line.endX, line.endY, paintFill);
}

It should be the same for the circles and rectangles. :)
[Java for Android App Development] darthvader45:
I can't add the field Color color because it will conflict with the color integer I already have there.
[Java for Android App Development] darthvader45:
I can't add the Color color field to MyLine, etc. because it will conflict with the int color already there.
[Java for Android App Development] nikwen:
Ah. I did not see that.

Replace the old one by the new one because the old one is never used. However, you will need to change it in the MyDrawable class.
[Java for Android App Development] darthvader45:
I submitted what I had, and I hope I did well. Thank you so much for all your help! I might contact you in the future should I require any more help. Thanks again! Josh
[Java for Android App Development] nikwen:
Great.

Good luck with your projects! ;)

Btw, if you need a designer/ themer, have a look at this thread: http://xdaforums.com/showthread.php?t=2269526
[AT&T Samsung Galaxy S 4 General] MattMJB0188:
Serously folks, we need to get their attention on the issues the S4 has. "But my device doesn't lag," well you're just not noticing it then because the majority are reporting lag. We need them to take note of this and push a software update out ASAP, or people will be returning their phones.

Call them!!! 1-888-987-4357!!!
[AT&T Samsung Galaxy S 4 General] akira02rex:
Make sure to note the locked bootloader as well. :laugh:
[AT&T Samsung Galaxy S 4 General] jrollercoasters:
Especially because this is the phone that'll get iCrap users over, dont want them to get a bad taste of android and never come back, because that isn't android..

Sent from my PC36100 using Xparent Skyblue Tapatalk 2
[AT&T Samsung Galaxy S 4 General] Bataga:
I'll call them and thank them for making my phone be unique and lag free! Everything I own is very quick so I think I would notice any lag. My gs4 is all around awesome
[AT&T Samsung Galaxy S 4 General] MattMJB0188:
You have it, you just don't see it. I bet you anything if I used your phone I'd notice it in a second.
[AT&T Samsung Galaxy S 4 General] j510:
Wrong . Used my cousins s4 and instantly noticed lag like crazy. On my s4 its very fluid. Compared it to my brothers galaxy nexus and is very fluid. No lag on my end.
[AT&T Samsung Galaxy S 4 General] raqball:
Another lag thread where people say they have lag and other people say they don't..

Just what we needed... I think there are 10 different lag threads now.. :o
[AT&T Samsung Galaxy S 4 General] LeKtRiCzzz:
I have no lag on mine, battery life is great. I played with my friends S4 and unlocking the phone stalled a bit, the transitions werent smooth but mine is smooth as butter
[AT&T Samsung Galaxy S 4 General] LouRock:
+1

This is the real issue!
[AT&T Samsung Galaxy S 4 General] MattMJB0188:
Lag is subjective. Those not experiencing it don't seem to get that.
[AT&T Samsung Galaxy S 4 General] blkhwkz:
Kind of amusing you even say lag is subjective. Just like when you told someone who said they have no lag they do, but they just don't know it. If someone is happy with their phone and doesn't feel like they have lag, why do you care?

I have no lag on my S4 and I know it, that's my opinion. I have played with another S4 that did lag.
[AT&T Samsung Galaxy S 4 General] LeKtRiCzzz:
I dont see how lag can be subjective either you it have or you dont
[AT&T Samsung Galaxy S 4 General] MattMJB0188:
The kind of lag I am talking about I have seen in every review video. I am sure you got a magical device that doesn't have any.
[AT&T Samsung Galaxy S 4 General] rip93:
I'm gonna go out on a limb and say the existing lag is no different from any other Android phone I have owned recently (gs3, nexus4, note 2). Always a frame drop here and there. No biggie. I think the next update will address some of it. I'm not too worried. I am loving the phone. I don't think it's so bad that it would deter any iPhone converts, but in don't really care either way.
[AT&T Samsung Galaxy S 4 General] occupational_hazard:
Now you are just acting like a butthurt iOS user.
[AT&T Samsung Galaxy S 4 General] Prodian:
Right a merge would be nice.

...no lag here....
[AT&T Samsung Galaxy S 4 General] occupational_hazard:
Op will make 3rd thread about Samsung response and for others to post theirs.
[AT&T Samsung Galaxy S 4 General] LeKtRiCzzz:
And I am sure your just jealous your device isn't magical
[AT&T Samsung Galaxy S 4 General] flinttownbrown:
Hah I called them just to complain about the bootloader being locked (I have no lag)... first woman did not know, transferred me to an escalated support staff member.

He stated that the bootloader was locked at the request of at&t and that it would be up to them to provide me a method to unlock it. When I mentioned that HTC also locks their bootloaders but provides a way to unlock them via htcdev he said that they would not be doing this at the request of the carrier.

Nothing that we didn't already know, but I now have a sense of just how little Samsung really cares about the developer community. They don't give a **** about us, and it doesn't seem like that is going to change. Bottom line: get used to it. I really like this phone but my conversation with them has seriously made me question if I will ever buy one of their phones again.
[AT&T Samsung Galaxy S 4 General] paleman27:
Aight...In perspective... I have a little lag. It's not a 2 second lag freeze, but maybe a .5 sec or a sec. However, for a quad core 1.9 ghz is unacceptable. I'm in since the Captivate, SG2, SG3 and this... At first I didn't think much of it, but when I compare it to my wife's Iphone 5...the transition between apps is not what is suppose to be: "Superior grade".

The phone is very nice. So much people jumping to Android from Iphone in the last 3 quarters... the overturn is incredible... Samsung, you were doing so well, don't fu... this up!
[AT&T Samsung Galaxy S 4 General] joshyy_rey:
So what if they push an update....AT&T would have to go through it first and that's a 3 month process at minimum :p
[AT&T Samsung Galaxy S 4 General] Bataga:
Just as smooth as my nexus 10. You wanna tell me that's lagging too? Maybe you expect it to operate just by thinking, although that may make it run slower
[AT&T Samsung Galaxy S 4 General] ViciousLSD:
I don't really notice lag however my gs4 crashed in the middle of a phone call yesterday.
[AT&T Samsung Galaxy S 4 General] goobieracing:
I rooted it and used setcpu and set it to interactive and noop and its the beast she should be
[AT&T Samsung Galaxy S 4 General] ViciousLSD:
I guess i will root and give that a try as well
[AT&T Samsung Galaxy S 4 General] Naddict:
lag discussion posts are getting duplicative, go here for discussion...http://xdaforums.com/showthread.php?t=2263311
[Galaxy S III Q&A, Help & Troubleshooting] evilol:
what should i do?! im got a sick of it! i can't see pictures on my gallery but they are on phone!!!! what should i do? it happened since i flashed 4.2 cursed roms! : (
[Galaxy S III Q&A, Help & Troubleshooting] squ89r97:
Is the file system still like 4.2? With 0's?
[Galaxy S III Q&A, Help & Troubleshooting] evilol:
yes! and i don't know what to do..!
[Galaxy S III Q&A, Help & Troubleshooting] squ89r97:
Best thing you can do is start new! Flash a stock 4.1.x rom through odin on your PC, then do the rooting process again.
[Galaxy S III Q&A, Help & Troubleshooting] brightsteel:
Simple Fix.

Since you're using a AOSP rom the internal storage is emulated and all the phone data is stored in the '0' folder.The rom can access only the data inside the '0' folder..so all you need to do is move your files from your internal sd card into the '0' folder ..then the rom wll be able to access them.

Hope this helped.:)
[Galaxy S III Q&A, Help & Troubleshooting] evilol:
did it 1000 times, in the start it showed me when i moved them to a folder named 0, but now it doesn't show them when i move them to a folder 0 too! im out of reasons, what can i do more?
[Galaxy S III Q&A, Help & Troubleshooting] Ryanscobberwash:
Personally i save all my photos on my sd card and have never had any problems with the galery showing photos so if you have an sd card id reccomend doing that :p
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] sandy7:
U lazy ????

Plz search from next time..

Follow this to fix it

http://xdaforums.com/showthread.php?t=2104484
[One (M7) Q&A, Help & Troubleshooting] milesmarrero:
This time around, Sense 5 isn't bad, and is pretty smooth. But in comparison to my old nexus 4, I miss the stock android opening/closing animation for apps etc. I installed carbon rom for pure aosp but it isn't near the stability of full sense. Is there any way tp keep sense but just change the app transitions? I used nova launcher but it didn't fully change them and was slightly laggy. Sense 5 with the aosp app opening and closing animations and smoothness of the animations would be perfection. Possible?
[One (M7) Q&A, Help & Troubleshooting] xXxG0dzRAgexXx:
In the TrickDroid 5.3.0 rom you can get stock animations when you flash the tweaks zip after installing TrickDroid.

Sign up for Copy! A great dropbox alternative that gives you tons of FREE space! http://copy.com?r=luU4NP

Start off with 10 gigabytes of free storage with my referral!
[One (M7) Q&A, Help & Troubleshooting] milesmarrero:
I have trickdroid and don't recall that option anywhere in there?
[One (M7) Q&A, Help & Troubleshooting] xXxG0dzRAgexXx:
Did you install the tweak package?
[One (M7) Q&A, Help & Troubleshooting] milesmarrero:
yeah where is that option? Are you talking about removing sense and putting nova or what?
[One (M7) Q&A, Help & Troubleshooting] xXxG0dzRAgexXx:
No not that. I would go though aroma again to check but no way. Too much freezing for me. :P Maybe I'm just crazy and that option isn't actually there lol. Could be in the theme.zip. I flashed both so can't remember which it would be in.
[One (M7) Q&A, Help & Troubleshooting] milesmarrero:
Alright thanks ill flash both and check. Im updating trickdroid versions right now haha
[Galaxy Tab Q&A, Help & Troubleshooting] ramu123:
I am using GT-P1000 ...intially it was in 2.2 ...later i upgraded it to 4.0.2....i had problem with this.....so i downgraded it to 2.3.6

by directly installing os 2.3.6 by using odin .....but it failed ......showing samsung logo

and iam also getting errors in recovery mode like

E part(1) DATA Checksum Error

E part(1) Checksum error

Internal MMC checksum verify failed

so ..how should i proceed...any one help plzz..
[Galaxy Tab Q&A, Help & Troubleshooting] priyana:
When restock to GB, you need a pit file.

You can follow my signature to Overcome method
[Galaxy Tab Q&A, Help & Troubleshooting] rakionowner:
Use overcome method by clicking priyana's signature link :)
[LG Optimus L9 P760, P765, P768, P769] traker4:
Does p760 supports GLONASS?

I think GPS test shows GLONASS satellites, but can someone confirm?

I can't find any official info that p760 supports GLONASS
[Galaxy S 4 i9505 Original Android Development] asgard:
All Credit to team TWRP / Dees_Troy...Finally working recovery for i9505!

Download the latest 2.6.1.0 tar and img files here: http://www.teamw.in/project/twrp2/182

Update 29/8: There are new releases in both TAR and IMG format directly from the TWRP main site. 2.6.1.0 is out!
[Galaxy S 4 i9505 Original Android Development] lukemo:
It works, now I trying a backup. Seems successful! Thanks a lot.
[Galaxy S 4 i9505 Original Android Development] FearKill:
I would rather see a tar.md5 file then just tar file.

http://www.multiupload.nl/ZQK1OKW1LP

Have one here and would rather see that people use that one, have tried myself and work.
[Galaxy S 4 i9505 Original Android Development] asgard:
Updated link accordingly :)
[Galaxy S 4 i9505 Original Android Development] TheMrCaveman:
Thanks for sharing! Just flashed it on my Phone and works like a charm.
[Galaxy S 4 i9505 Original Android Development] Taker18:
Works like a charm :))
[Galaxy S 4 i9505 Original Android Development] gav83collins:
yes boots and working fine, between boots, but....lack of storage space for system/data (16gb version) and ability to switch to external isnt available as yet..........but, early work,

other options like efs, cache etc all working fine

thanks

EDIT.....MY BAD, JUST TOUCH WHERE IT SHOWS U STORAGE SPACE
[Galaxy S 4 i9505 Original Android Development] harise100:
Are we talking about the same?

I can access my 64gb extFAT sd card just fine! Started Aroma-Filemanager from it.

Touch is a bit too sensitive, but in general it seem to work fine.:D
[Galaxy S 4 i9505 Original Android Development] gav83collins:
how ? i dont see no option to switch storage, but il go and check now

ha ha ha its touch, durrrrrrrrrrrrrrrrrrrrr, found it
[Galaxy S 4 i9505 Original Android Development] mrlove6:
dont be glad so much guys, touch works indeed

But when it comes for installing a rom, touch works no more...i had to continue it with the hard keys,

But one more thing, while installing the omega rom it was so laggy and end with phone shuted down...so no rom flashed
[Galaxy S 4 i9505 Original Android Development] joelvn:
Just flashed the img file using the emulator in rom toolbox and it worked great :thumbup:

Flowed from my GT-I9505 using xda-developers app
[Galaxy S 4 i9505 Original Android Development] asgard:
Omega ROM has been pulled for further testing so there may certainly be issues there, and no doubt there will be further fixes for TWRP :)
[Galaxy S 4 i9505 Original Android Development] mrlove6:
in fact i have already flashed the rom, but guess what ??? it never boot up lol stuck on samsung logo
[Galaxy S 4 i9505 Original Android Development] RejjvarN:
Flashed this and it works fine! Many thanks!
[Galaxy S 4 i9505 Original Android Development] blackknightavalon:
Six days since T-Mobile opened up orders on this device, five days since I got my hands on one, and now there's working TWRP. All Cyanogen needs to do is fix the externalSdCard issue in his 10.1 build and this phone will be nearly perfect.
[Galaxy S 4 i9505 Original Android Development] roan67:
Same for me, working to prérooted mdn v2 by Djembey.

many thanks :good:
[Galaxy S 4 i9505 Original Android Development] orion13236:
doesn't works for me :(

S4 I9505

Issue : flash with odin ok but boot on recovery STOCK finally.

My bootloader is locked, maybe is it the problem ?
[Galaxy S 4 i9505 Original Android Development] thedt:
Australian S4 I9505 didn't boot recovery. Is there a way to pull some debug logs for you?
[Galaxy S 4 i9505 Original Android Development] boqonx:
Confirmed to be working on Singaporean i9505!
[Galaxy S 4 i9505 Original Android Development] AMDPOWERFIST:
Worked fine on my Telstra acquired I9505...

Download files > place file into ODIN (PDA) > reboot phone to DOWNLOAD MODE > run ODIN > boot to recovery

worked like a charm, thanks heaps.
[Galaxy S 4 i9505 Original Android Development] secany:
Confirm the bug on v2.5.0.2: if you select cache + dalvik cache then wipe, YOUR DATA GONE too. Don't know is recovery problem (likely) or Omega rom problem. Tested twice.

And backup date problem still exist on v2.5.0.2
[Galaxy S 4 i9505 Original Android Development] bigpp85:
I wiped cache and dalvik cache with twrp 2502 three times and my data wasn't wiped!
[Galaxy S 4 i9505 Original Android Development] 9Lukas5:
Can I flash the recovery from android terminal emulator when I downloaded the img file from the twrp website?

L
[Galaxy S 4 i9505 Original Android Development] hanspampel:
If you are on a custom recovery, look at here
[Galaxy S 4 i9505 Original Android Development] kenzolo:
twrp 2.5.0.3 is up!!
[Galaxy S 4 i9505 Original Android Development] Leonardus97:
Does everything work ATM? I'd really like to flash this...
[Galaxy S 4 i9505 Original Android Development] hanspampel:
Flashable Zip attached. This one is a smaller version.:o
[Galaxy S 4 i9505 Original Android Development] starbucks2010:
any changelog?

thank you
[Galaxy S 4 i9505 Original Android Development] stesmi:
2.5.0.3 has problems. 1 attempt in 10 lands me in recovery, the others hang on the TeamWin page.

Solution when it hangs:

Hold power button until it turns off, then press it again while holding volume down, at the choice press volume down again to boot normally.

Or - of course - just boot it without pressing volume down to try to get into recovery again...

// Stefan