Giter Site home page Giter Site logo

flying's Introduction

flying's People

Contributors

superyodi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flying's Issues

splash feature에 DB작업 추가

if Date() not in report table (새벽5시 기준)

  1. 오늘보다 이전에 만든 뽀모도로 중 [오늘하루만] DB에서 삭제 in pomodoro table
  2. insert [today report] in report table
  3. [매일매일] 뽀모도로 중 duedate이 오늘보다 오래된 것들 DB에서 삭제 in pomodoro table
    • 삭제하지않은 뽀모도로의 nowCount, state, lefttime 속성 init

pomolist ui 구현

  • 티켓 ui
  • 추가 버튼
  • margin, radius 등 디테일한 부분 구현

report 관련 테이블 생성

사용자의 행위를 report 기능과 관련된 ticket feature, report feature와 연관된 테이블들을 생성한다.

  • Ticket : 티켓에 보여지는 데이터들을 담고있다.
  • Task: 티켓에 보여지는 task
    • 사용자가 특정 도시에 2시간동안 머물 동안 실행한 뽀모도로 내역들을 저장한다.
  • Report: 사용자의 하루 활동을 저장한다.

TimerService 로직 수정 (근데이제 user,ticket,task table을 곁들인)

  • pomodoro 관련 로직
    • running time 시작할때
    • running time 끝날때 ticketCount ++
  • ticket 관련 로직
    • running time 끝날때 report의 totalTime ++
      • totlaTime이 depth * 2 를 넘어갈때 report의 city depth update, 현재 ticket의 endTime update
  • task 관련 로직
    • primaryKeys = [ "userId", "date", "cityTime", "pomoId"]) 로 검색한 값이
      • null 일때 --> insert
      • null이 아닐때 --> totalTime, count update

TimerService 타이머 기능 구현

  • Timer State에 맞게 TimerFragment 생명주기 관리
  • Pomodoro State에 따라 UI 변경 ( 현재 상태를 표시하는 부분)
  • Pomodoro State에 따라 Timer 시간 변경

날짜가 변경됐을때 뽀모도로 리스트 데이터 초기화

  1. 매일 새벽 5시마다 사용자 데이터를 초기화 하려고 한다

  2. SplashActivity에서 현재 시간과 가장 최근에 초기화 된 시간을 비교해서 초기화가 필요하다면 초기화 한 후 MainActivity로 이동하는 로직을 작성했다.

    MainActivity.kt
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    
        Timber.d("splash activity started")
    
        binding = DataBindingUtil.setContentView< ActivitySplashBinding>(this, R.layout.activity_splash)
    
        setupTimber()
    
        val userId = splashViewModel.getUserId()
        if(userId == -1L || userId == 0L)
            navigateToLogIn()
        else {
            splashViewModel.initTodayData()
            navigateToHome()
        }
    }
  3. 하지만 사용자가 MainActivity에서 홈버튼을 눌러서 stopped 된 이후 다음날 새벽 5시 이후에 MainActivity가 restarted 되면 사용자 데이터가 초기화 되지 않는 문제가 발생했다.

  4. 그래서

    MainActivity.kt
    
    override fun onRestart() {
        super.onRestart()
        Timber.d("restarted")
        navigateToSplash()
    }
    

    일단 이렇게 onRestart()가 콜백되면 SplashActivity로 이동하도록 했는데

    PomodoroListFragment의 onCreate()에서 initTodayData() 부분이 실행되도록 해야하는지 잘 모르겠다.

일부 UI 수정

  • 상단바 색깔
  • 상단바 타이틀 수정
  • 상단바 뒤로가기 버튼 구현
  • 버튼 radius
  • 애니메이션

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.