Skip to content

Solution for issue #167 #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
// gesture detector
private Gestures detector;
private ShortcutUtils shortcutUtils;

private static boolean judge = true;


private static final TextWatcher mTextWatcher= new TextWatcher() {

Expand Down Expand Up @@ -217,7 +220,14 @@ protected void onCreate(Bundle savedInstanceState) {

int theme = DbUtils.getTheme();
//theme must be set before setContentView
setTheme(theme);
if(judge){
int hour = new Date(System.currentTimeMillis()).getHours();
setTheme(hour<=19 && hour>=7 ? R.style.BlackOnGrey : R.style.Black);
judge = false;
}
else{
setTheme(theme);
}

setContentView(R.layout.activity_launcher);

Expand Down Expand Up @@ -1333,4 +1343,4 @@ protected Void doInBackground(final Integer... integers) {
return null;
}
}
}
}