From c575779b583ad31881c49233fe0c7370c942751e Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Thu, 22 Oct 2020 11:39:31 +0200 Subject: [PATCH] fix portrait orientation --- .../java/im/status/keycard/connect/ui/ChangePINActivity.kt | 2 ++ .../java/im/status/keycard/connect/ui/ChangePUKActivity.kt | 2 ++ .../status/keycard/connect/ui/ChangePairingPasswordActivity.kt | 2 ++ app/src/main/java/im/status/keycard/connect/ui/InitActivity.kt | 2 ++ .../main/java/im/status/keycard/connect/ui/LoadKeyActivity.kt | 2 ++ app/src/main/java/im/status/keycard/connect/ui/MainActivity.kt | 2 ++ app/src/main/java/im/status/keycard/connect/ui/PINActivity.kt | 2 ++ app/src/main/java/im/status/keycard/connect/ui/PUKActivity.kt | 3 +++ .../main/java/im/status/keycard/connect/ui/PairingActivity.kt | 2 ++ .../java/im/status/keycard/connect/ui/ReinstallActivity.kt | 2 ++ .../java/im/status/keycard/connect/ui/ShowMnemonicActivity.kt | 2 ++ .../java/im/status/keycard/connect/ui/SignMessageActivity.kt | 3 +++ .../im/status/keycard/connect/ui/SignTransactionActivity.kt | 2 ++ 13 files changed, 28 insertions(+) diff --git a/app/src/main/java/im/status/keycard/connect/ui/ChangePINActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/ChangePINActivity.kt index 539ba06..b031fed 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/ChangePINActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/ChangePINActivity.kt @@ -1,5 +1,6 @@ package im.status.keycard.connect.ui +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -16,6 +17,7 @@ class ChangePINActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_change_pin) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val pinText = findViewById(R.id.newPINText) val pinConfirmation = findViewById(R.id.pinConfirmation) diff --git a/app/src/main/java/im/status/keycard/connect/ui/ChangePUKActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/ChangePUKActivity.kt index e52d742..d311033 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/ChangePUKActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/ChangePUKActivity.kt @@ -1,5 +1,6 @@ package im.status.keycard.connect.ui +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -16,6 +17,7 @@ class ChangePUKActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_change_puk) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val pukText = findViewById(R.id.newPUKText) val pukConfirmation = findViewById(R.id.pukConfirmation) diff --git a/app/src/main/java/im/status/keycard/connect/ui/ChangePairingPasswordActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/ChangePairingPasswordActivity.kt index 3fcd808..1c8dfee 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/ChangePairingPasswordActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/ChangePairingPasswordActivity.kt @@ -1,5 +1,6 @@ package im.status.keycard.connect.ui +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -16,6 +17,7 @@ class ChangePairingPasswordActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_change_pairing_password) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val pairingPasswordText = findViewById(R.id.newPairingPasswordText) val pairingPasswordConfirmation = findViewById(R.id.pairingPasswordConfirmation) diff --git a/app/src/main/java/im/status/keycard/connect/ui/InitActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/InitActivity.kt index a7ab8e8..5fbcdb0 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/InitActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/InitActivity.kt @@ -2,6 +2,7 @@ package im.status.keycard.connect.ui import android.app.Activity import android.content.Intent +import android.content.pm.ActivityInfo import android.os.Bundle import android.util.Base64 import android.util.Base64.NO_PADDING @@ -23,6 +24,7 @@ class InitActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_init) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; pin = String.format("%06d", Crypto.randomLong(Crypto.PIN_BOUND)) puk = String.format("%012d", Crypto.randomLong(Crypto.PUK_BOUND)) diff --git a/app/src/main/java/im/status/keycard/connect/ui/LoadKeyActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/LoadKeyActivity.kt index 978a48b..d7be176 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/LoadKeyActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/LoadKeyActivity.kt @@ -2,6 +2,7 @@ package im.status.keycard.connect.ui import android.app.Activity import android.content.Intent +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.EditText @@ -15,6 +16,7 @@ class LoadKeyActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_load_key) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; } fun generateBIP39(@Suppress("UNUSED_PARAMETER") view: View) { diff --git a/app/src/main/java/im/status/keycard/connect/ui/MainActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/MainActivity.kt index fdf47cc..6e8594b 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/MainActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/MainActivity.kt @@ -2,6 +2,7 @@ package im.status.keycard.connect.ui import android.app.Activity import android.content.Intent +import android.content.pm.ActivityInfo import android.nfc.NfcAdapter import android.os.Bundle import android.util.Log @@ -29,6 +30,7 @@ class MainActivity : AppCompatActivity(), ScriptListener, WalletConnectListener override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) viewSwitcher = ViewSwitcher(this) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val inflater = LayoutInflater.from(this) inflater.inflate(R.layout.activity_main, viewSwitcher) diff --git a/app/src/main/java/im/status/keycard/connect/ui/PINActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/PINActivity.kt index 628f54a..9c664cf 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/PINActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/PINActivity.kt @@ -1,6 +1,7 @@ package im.status.keycard.connect.ui import android.app.Activity +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -20,6 +21,7 @@ class PINActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_pin) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val attempts = intent.getIntExtra(PIN_ACTIVITY_ATTEMPTS, -1) cardUID = intent.getByteArrayExtra(PIN_ACTIVITY_CARD_UID)!! diff --git a/app/src/main/java/im/status/keycard/connect/ui/PUKActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/PUKActivity.kt index e6e099c..0f93c05 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/PUKActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/PUKActivity.kt @@ -1,6 +1,7 @@ package im.status.keycard.connect.ui import android.app.Activity +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -19,6 +20,8 @@ class PUKActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_puk) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + val attempts = intent.getIntExtra(PUK_ACTIVITY_ATTEMPTS, -1) val attemptLabel = findViewById(R.id.attemptLabel) diff --git a/app/src/main/java/im/status/keycard/connect/ui/PairingActivity.kt b/app/src/main/java/im/status/keycard/connect/ui/PairingActivity.kt index 55fdde1..87f1ecc 100644 --- a/app/src/main/java/im/status/keycard/connect/ui/PairingActivity.kt +++ b/app/src/main/java/im/status/keycard/connect/ui/PairingActivity.kt @@ -2,6 +2,7 @@ package im.status.keycard.connect.ui import android.app.Activity import android.content.Intent +import android.content.pm.ActivityInfo import android.os.Bundle import android.view.View import android.widget.Button @@ -16,6 +17,7 @@ class PairingActivity : NoNFCActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_pairing) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; val passText = findViewById(R.id.passwordText) passText.doAfterTextChanged { findViewById