superyodi / flying Goto Github PK
View Code? Open in Web Editor NEW뽀모도로 타이머로 떠나는 방구석 세계여행
뽀모도로 타이머로 떠나는 방구석 세계여행
매일 새벽 5시마다 사용자 데이터를 초기화 하려고 한다
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()
}
}
하지만 사용자가 MainActivity에서 홈버튼을 눌러서 stopped 된 이후 다음날 새벽 5시 이후에 MainActivity가 restarted 되면 사용자 데이터가 초기화 되지 않는 문제가 발생했다.
그래서
MainActivity.kt
override fun onRestart() {
super.onRestart()
Timber.d("restarted")
navigateToSplash()
}
일단 이렇게 onRestart()가 콜백되면 SplashActivity로 이동하도록 했는데
PomodoroListFragment의 onCreate()에서 initTodayData()
부분이 실행되도록 해야하는지 잘 모르겠다.
primaryKeys = [ "userId", "date", "cityTime", "pomoId"])
로 검색한 값이
사용자의 행위를 report 기능과 관련된 ticket feature, report feature와 연관된 테이블들을 생성한다.
if Date() not in report table (새벽5시 기준)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.