Skip to content

Commit

Permalink
fix screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanChamelo committed Jun 1, 2024
1 parent e15e21c commit 09c6eb4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "git.artdeell.skymodloader"
minSdk 26
targetSdk 34
versionCode 34
versionName "1.5.1"
versionCode 35
versionName "1.5.2"
manifestPlaceholders = [
'appAuthRedirectScheme': 'com.googleusercontent.apps.704988078112-46vk837uhg8n7qf3lb8dut52o7ugm7v4'
]
Expand Down
31 changes: 31 additions & 0 deletions app/src/main/java/com/tgc/sky/SystemUI_android.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
Expand Down Expand Up @@ -68,6 +69,8 @@
import java.util.Objects;
import java.util.TimeZone;

import git.artdeell.skymodloader.SMLApplication;

public class SystemUI_android {
public static final int kInvalidDialogId = -1;
public static final int kInvalidLabelId = -1;
Expand All @@ -76,6 +79,8 @@ public class SystemUI_android {
private GameActivity m_activity;
private CodeScanner m_codeScanner;
private int m_currentId;
private boolean m_isOrientationLocked;

private float m_keyboardHeight;
private boolean m_keyboardIsShowing;
private LocalizationManager m_localizationManager;
Expand Down Expand Up @@ -183,6 +188,14 @@ public boolean GetMainWindowAttachedSheet() {
return !this.m_activity.getBrigeView().hasWindowFocus();
}

void AttemptRotationToDeviceOrientation() {
int i = this.m_useSensorOrientation ? 4 : 6;
if (i == this.m_activity.getRequestedOrientation() || this.m_activity.portraitOnResume || IsOrientationLocked()) {
return;
}
this.m_activity.setRequestedOrientation(i);
}

@SuppressLint("WrongConstant")
void SetUseSensorOrientation(boolean z) {
this.m_useSensorOrientation = z;
Expand All @@ -208,6 +221,24 @@ public boolean GetUseSensorOrientation() {
return this.m_useSensorOrientation;
}

void LockCurrentOrientation() {
this.m_isOrientationLocked = true;
if (SMLApplication.skyRes.getConfiguration().orientation == 2) {
this.m_activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
} else {
this.m_activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
}

void UnlockCurrentOrientation() {
this.m_isOrientationLocked = false;
AttemptRotationToDeviceOrientation();
}

boolean IsOrientationLocked() {
return this.m_isOrientationLocked;
}

int ShowTextField(final String str, final int i, final int i2) {
int TryActivate;
if (this.m_textField.getState() == TextField.State.kTextFieldState_Hidden && (TryActivate = this.m_textField.TryActivate()) != -1) {
Expand Down

0 comments on commit 09c6eb4

Please sign in to comment.