fix portrait orientation

This commit is contained in:
Michele Balistreri 2020-10-22 11:39:31 +02:00
parent 0e79fb7b51
commit c575779b58
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
13 changed files with 28 additions and 0 deletions

View File

@ -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<EditText>(R.id.newPINText)
val pinConfirmation = findViewById<EditText>(R.id.pinConfirmation)

View File

@ -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<EditText>(R.id.newPUKText)
val pukConfirmation = findViewById<EditText>(R.id.pukConfirmation)

View File

@ -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<EditText>(R.id.newPairingPasswordText)
val pairingPasswordConfirmation = findViewById<EditText>(R.id.pairingPasswordConfirmation)

View File

@ -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))

View File

@ -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) {

View File

@ -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)

View File

@ -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)!!

View File

@ -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<TextView>(R.id.attemptLabel)

View File

@ -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<EditText>(R.id.passwordText)
passText.doAfterTextChanged { findViewById<Button>(R.id.okButton).isEnabled = passText.text.toString().isNotEmpty() }
}

View File

@ -1,6 +1,7 @@
package im.status.keycard.connect.ui
import android.content.Intent
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.view.View
import android.widget.CheckBox
@ -14,6 +15,7 @@ class ReinstallActivity : NoNFCActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reinstall)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
}
fun reinstall(@Suppress("UNUSED_PARAMETER") view: View) {

View File

@ -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.TextView
@ -11,6 +12,7 @@ class ShowMnemonicActivity : NoNFCActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_show_mnemonic)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
val mnemonic = intent.getStringArrayExtra(MNEMONIC_PHRASE)
val mnemonicView = findViewById<TextView>(R.id.mnemonicView)

View File

@ -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.TextView
@ -13,6 +14,8 @@ class SignMessageActivity : NoNFCActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sign_message)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
val signText = findViewById<TextView>(R.id.signText)
signText.text = intent.getStringExtra(SIGN_TEXT_MESSAGE)
}

View File

@ -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.TextView
@ -16,6 +17,7 @@ class SignTransactionActivity : NoNFCActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sign_transaction)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
findViewById<TextView>(R.id.signTxAmount).text = intent.getStringExtra(SIGN_TX_AMOUNT)
findViewById<TextView>(R.id.signTxCurrency).text = intent.getStringExtra(SIGN_TX_CURRENCY)