GithubHelp home page GithubHelp logo

androidchessclock's Introduction

GOOGLE PLAY

https://play.google.com/store/apps/developer?id=John+Wilde

NOTES

Rewritten to use Mosby library for cleaner separation between views and business logic.

Chess Clock

In this Chess Timer app there are two players (White and Black) and each player has a button they can tap. A player taps his button to end his turn and start the other player's turn. During a player's turn, their remaining time counts down, and the other player sees the time-gap on their view go up. This diagram shows the important parts of the UI which includes two ClockView and one MainView component.

There are 3 presenters:

  • MainViewPresenter which renders the play/pause button and the mainSubject
  • ClockViewPresenter for responding to button taps and updating time
  • SoundViewPresenter for playing button click and end-of-game buzzer

MVI diagram for the ClockViewPresenter

This diagram shows the MVI interactions for the ClockView portion of the app. This view consists of a button the player can tap, a view that shows the time remaining and a view that shows the time difference between the clocks. The ClockFragment implements a simple interface which has just two methods: clickIntent and render. clickIntent represents a touch by the user on the button indicating they intend to end their turn. render receives updated ClockViewModel instances which the fragment will draw.

There is a ClockViewPresenter associated with each view. When user touches their button the "intent" is forwarded through the presenter to the business logic. For this view, if the user performed an invalid tap (e.g., at the start of game the Black player must tap his button to kick things off) - the presenter responds with a Snackbar message instead of calling the method on the clock manager that would start the game. I chose to put the generation of an error message in the presenter rather than the clock manager in order to keep the business logic purely concerned with actions that change state of the game.

The business logic layer has no knowledge of the view or Android classes - it consists of aClockManager which holds two TimerLogic instances. While a game is underway, each TimerLogic instance periodically generates a new ClockViewState to show the time update. The new state is published using a PublishSubjectthat the presenter has subscribed to.

androidchessclock's People

Contributors

johnwilde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

androidchessclock's Issues

Affix of Name Player and Share App Button on Android Chess Clock

Proposal

After using this application for some time, I found two features that this application must have for the progress of the application. So, I want to share my opinion and here are my proposals.

  • Name Player
  • Share App

Name Player
This feature allows users to add their names to their Chess Clock display and users can also edit the name according to the names of the two chess players who will play chess.

Share App
This feature allows users to share and disseminate the use of this application. Users can share this application with others, especially chess lovers. Users can share this application through their various social media.

Benefits

Practically, the two above recommended features will be added value on Chess Clock.
The Name Player feature makes the names of the two chess players displayed on the main page of Chess Clock. Displaying the name will make the user's attention better when using the application and the main page becomes more interesting.
The Share App feature allows users to share this application with others so they can also use this application and make the use of time in their chess games more transparent. Now they can do it through their smartphone.

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.