Skip to content

Commit

Permalink
Make screen stay on while using the app (user can always hit their po…
Browse files Browse the repository at this point in the history
…wer button to turn it off manually). Addresses issue #76.
  • Loading branch information
VanceVagell committed Dec 3, 2024
1 parent 6fc36e1 commit cb20bec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kv4p HT (see http://kv4p.com)
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
Expand Down Expand Up @@ -52,6 +53,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_edit_memory);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

threadPoolExecutor = new ThreadPoolExecutor(2,
2, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ kv4p HT (see http://kv4p.com)
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;
Expand Down Expand Up @@ -161,6 +162,8 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

threadPoolExecutor = new ThreadPoolExecutor(2,
10, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ kv4p HT (see http://kv4p.com)
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.CompoundButton;
Expand Down Expand Up @@ -58,6 +59,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

threadPoolExecutor = new ThreadPoolExecutor(2,
2, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());

Expand Down

0 comments on commit cb20bec

Please sign in to comment.