Fix #1461️ Keep the screen on

Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
Stefan Niedermann 2022-04-21 09:15:07 +02:00
parent 4cc3ca1038
commit d721cb128d
3 changed files with 11 additions and 1 deletions

View file

@ -1,12 +1,12 @@
package it.niedermann.owncloud.notes.edit;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.NonNull;
@ -72,6 +72,8 @@ public class EditNoteActivity extends LockedActivity implements BaseNoteFragment
return;
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
categoryViewModel = new ViewModelProvider(this).get(CategoryViewModel.class);
binding = ActivityEditBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
@ -99,6 +101,12 @@ public class EditNoteActivity extends LockedActivity implements BaseNoteFragment
launchNoteFragment();
}
@Override
protected void onStop() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
super.onStop();
}
private long getNoteId() {
return getIntent().getLongExtra(PARAM_NOTE_ID, 0);
}

View file

@ -1,3 +1,4 @@
- 🐞 Detect missing Notes app on server when importing an account (#1475)
- ⚙️ Remove incomplete and outdated translations
- ⚙️ Updated dependencies
- ⚙️ Requires Android ≥ 6.0 (matching the Nextcloud Android app)

View file

@ -0,0 +1 @@
- 📱️ Keep the screen on (#1461)