Giter VIP home page Giter VIP logo

tikinow's Introduction

TikiNow example

  • This is Tiki Now example written by Java base on MVP architecture pattern.
  • Show list of hot key as the below: HotKey Horizontal Listview

Feature:

  • If the keyword is more than one word, then display in two lines.
  • Background color is random.

Technical:

  • MVP architecture pattern.
  • Horizontal List View

APK file:

APK download

Direction for testcase:

 public static final String[] HOT_KEY_LIST_DEMO =  {
           "xiaomi",
           "bitis hunter",
           "bts",
           "balo",
           "bitis hunter x",
           "tai nghe",
           "harry potter",
           "anker",
           "iphone",
           "balo nữ",
           "nguyễn nhật ánh",
           "đắc nhân tâm",
           "ipad",
           "senka",
           "tai nghe bluetooth",
           "son",
           "maybelline",
           "laneige",
           "kem chống nắng",
           "anh chính là thanh xuân của em",
   };
  • List of colors for Background:
    public static final int [] HOT_KEY_LIST_COLOR = {
            R.color.color_green,
            R.color.color_green_1,
            R.color.color_yellow,
            R.color.color_purple,
            R.color.color_blue,
            R.color.color_yellow_1,
            R.color.color_red,
            R.color.color_blue_1,
    };

Run UnitTest with robolectric

  • Here is example to test feature, If the keyword is more than one word, then display in two lines.
@Test
 public void testHotKeySingleWord() throws Exception {
     String keyword = "xiaomi";
     String printKeyword = "xiaomi";

     HotKey hotKey = new HotKey(keyword);
     Assert.assertEquals(printKeyword, hotKey.getFormatKeyword());
     Assert.assertEquals(keyword, hotKey.getKeyword());
     Assert.assertEquals(hotKey.getKeyword(), hotKey.getFormatKeyword());
 }
@Test
public void testHotKeyLongWord() throws Exception {
    String keyword = "bitis hunter x";
    String printKeyword = "bitis \nhunter x";

    HotKey hotKey = new HotKey(keyword);
    Assert.assertEquals(printKeyword, hotKey.getFormatKeyword());
    Assert.assertEquals(keyword, hotKey.getKeyword());
    //Keyword will not same format keyword
    Assert.assertNotEquals(hotKey.getKeyword(), hotKey.getFormatKeyword());
}
  • More about unit test: ref to

tikinow's People

Watchers

Linh Do avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.