Grand Exchange Plugin redesign

General:
- Applied the design I proposed in issue #1342
- Applied custom component: MaterialTabs
- Removed default scrolling behaviour from parent PluginPanel
- Added error panels for empty searches and empty offer slots
- Added new formatter to the StackFormatter that displays integers
as rs stacks with decimals (21700 into 21.7k)
- Changed the Locale on the stack formatter and respective unit testing
to UK, this makes sure all tests are consistent with Travis (ex: i ran
the unit testing in europe, travis ran in the us, so it passed my tests,
failed his)

Offers:
- Refactored the GE offers into it's own seperate file:
GrandExchangeOffersPanel
- Redesigned the ge offers items
- Included the custom component ThinProgressBar on the bottom of each
ge item panel
- Added secondary information panel, toggled by clicking on the primary
panel
- Added a game state check that resets all ge offers on logout

Search:
- Recoloured and resized the search bar
- Added new icons to the search bar (incluing a loading wheel gif)
- Removed focus on the search bar when results are displayed
- Added custom scrolling behaviour
- Blocked input when search is in progress
This commit is contained in:
Ruben Amendoeira
2018-04-22 04:24:46 +01:00
parent e56e559ecd
commit ab7e969320
13 changed files with 699 additions and 216 deletions

View File

@@ -26,12 +26,39 @@ package net.runelite.client.util;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
public class StackFormatterTest
{
@Before
public void setUp()
{
Locale.setDefault(Locale.ENGLISH);
}
@Test
public void quantityToRSDecimalStackSize()
{
assertEquals("0", StackFormatter.quantityToRSDecimalStack(0));
assertEquals("8500", StackFormatter.quantityToRSDecimalStack(8_500));
assertEquals("10K", StackFormatter.quantityToRSDecimalStack(10_000));
assertEquals("21,7K", StackFormatter.quantityToRSDecimalStack(21_700));
assertEquals("100K", StackFormatter.quantityToRSDecimalStack(100_000));
assertEquals("100,3K", StackFormatter.quantityToRSDecimalStack(100_300));
assertEquals("1M", StackFormatter.quantityToRSDecimalStack(1_000_000));
assertEquals("8,4M", StackFormatter.quantityToRSDecimalStack(8_450_000));
assertEquals("10M", StackFormatter.quantityToRSDecimalStack(10_000_000));
assertEquals("12,8M", StackFormatter.quantityToRSDecimalStack(12_800_000));
assertEquals("100M", StackFormatter.quantityToRSDecimalStack(100_000_000));
assertEquals("250,1M", StackFormatter.quantityToRSDecimalStack(250_100_000));
assertEquals("1B", StackFormatter.quantityToRSDecimalStack(1_000_000_000));
assertEquals("1,5B", StackFormatter.quantityToRSDecimalStack(1500_000_000));
assertEquals("2,1B", StackFormatter.quantityToRSDecimalStack(Integer.MAX_VALUE));
}
@Test
public void quantityToRSStackSize()