Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 327ffe3

Browse files
About & Change-logs: Temporarily block screen rotation
Signed-off-by: sunilpaulmathew <sunil.kde@gmail.com>
1 parent 036f66f commit 327ffe3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.annotation.SuppressLint;
44
import android.content.Context;
55
import android.content.Intent;
6+
import android.content.pm.ActivityInfo;
67
import android.os.Bundle;
78
import android.os.Handler;
89
import android.view.Menu;
@@ -264,6 +265,7 @@ private void restartApp() {
264265

265266
@SuppressLint("SetTextI18n")
266267
private void aboutDialogue(Context context) {
268+
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
267269
mCardTitle.setText(R.string.about);
268270
mAppName.setText(context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
269271
mCredits.setText(context.getString(R.string.credits_summary));
@@ -283,6 +285,7 @@ private void aboutDialogue(Context context) {
283285

284286
@SuppressLint("SetTextI18n")
285287
private void changeLogDialogue(Context context) {
288+
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
286289
mCardTitle.setText(R.string.change_logs);
287290
mAppName.setText(context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
288291
mChangeLog.setText(Utils.getChangeLogs(this));
@@ -310,6 +313,7 @@ private void closeForeground() {
310313
mCancel.setVisibility(View.GONE);
311314
mForegroundCard.setVisibility(View.GONE);
312315
Utils.mForegroundActive = false;
316+
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
313317
}
314318

315319
@Override

0 commit comments

Comments
 (0)