# HG changeset patch # User Vladimir Vukicevic # Date 1199249619 28800 # Node ID 8b7dc32c23bd5685b095fb41d38f383f131711d6 # Parent 4ceeda5fa53a293ff1e7ad21ea04459a37e16b6a Identify characters that are updating without hiding display of cached information. Use three yellow dots as a progress indicator in the corner of the portrait instead of replacing the information with "Loading". diff -r 4ceeda5fa53a293ff1e7ad21ea04459a37e16b6a -r 8b7dc32c23bd5685b095fb41d38f383f131711d6 src/org/mrrupert/eveberry/EveCharacterListField.java --- a/src/org/mrrupert/eveberry/EveCharacterListField.java Tue Jan 01 20:09:44 2008 -0800 +++ b/src/org/mrrupert/eveberry/EveCharacterListField.java Tue Jan 01 20:53:39 2008 -0800 @@ -47,9 +47,12 @@ int mCharNameWidth, mFontHeight; boolean mDidLayout; + int mLoadingCounter; + public EveCharacterField(EveCharacterInfo eci) { CharacterInfo = eci; mDidLayout = false; + mLoadingCounter = 0; } protected void layout(int width, int height) { @@ -88,6 +91,7 @@ int w = getWidth(); int h = getHeight(); int major, minor; + int portraitSize; int numRows = (h - 2) / mFontHeight; @@ -99,18 +103,28 @@ minor = w; } + portraitSize = minor-2; + // draw the character portrait if (CharacterInfo.getCharPortrait() != null) { - g.drawBitmap(1, 1, minor-2, minor-2, CharacterInfo.getCharPortrait(), 0, 0); + g.drawBitmap(1, 1, portraitSize, portraitSize, CharacterInfo.getCharPortrait(), 0, 0); } else { - g.setColor(0x00000000); - g.fillRect(1, 1, minor-2, minor-2); - g.setColor(0x00aaaaaa); - g.drawRect(1, 1, minor-2, minor-2); + g.setColor(Color.BLACK); + g.fillRect(1, 1, portraitSize, portraitSize); + g.setColor(Color.GRAY); + g.drawRect(1, 1, portraitSize, portraitSize); } + if (CharacterInfo.UpdateInProgress) { + g.setColor(Color.YELLOW); + g.fillRect(1 + portraitSize - 2 - 4 * (mLoadingCounter%3 + 1), + 1 + portraitSize - 5, + 3, 3); + mLoadingCounter++; + } + g.setFont(mFont); - g.setColor(g.BLACK); + g.setColor(Color.BLACK); String trainingString = null; if (CharacterInfo.SkillInTraining != null) @@ -121,9 +135,6 @@ w -= minor+2; major -= minor+2; - if (CharacterInfo.UpdateInProgress) - timeLeftWidth = 0; - // first row g.translate(minor+2, 1); @@ -152,11 +163,7 @@ g.translate(0, mFontHeight); - if (CharacterInfo.UpdateInProgress) { - g.setColor(0x00666666); - g.drawText("Updating...", 0, 0); - g.setColor(g.BLACK); - } else if (CharacterInfo.SkillInTraining != null) { + if (CharacterInfo.SkillInTraining != null) { String skillString = CharacterInfo.SkillInTraining + " " + CharacterInfo.getTrainingLevelString(); int skillStringWidth = mFont.getAdvance(skillString); @@ -184,19 +191,14 @@ barWidth, mFontHeight - 4 - 2*borderWidth); - g.setColor(g.BLACK); + g.setColor(Color.BLACK); } else { - g.drawText("NO SKILL IN TRAINING", 1, 1); - g.setColor(0x00ff0000); - g.drawText("NO SKILL IN TRAINING", 0, 0); - g.setColor(g.BLACK); + g.setColor(Color.RED); + g.drawText("No skill in training!", 1, 1); + g.setColor(Color.BLACK); } } - // we're done here if the update is in progress - if (CharacterInfo.UpdateInProgress) - return; - // third row, if room // SP if we have 4 rows, otherwise balance if (numRows > 2) {