diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInActivity.kt index 1f3a408c6..34fd1dbc5 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInActivity.kt @@ -125,23 +125,17 @@ class AuthSignInActivity : AppCompatActivity() { private fun openAccountPicker(packageName: String) { val binding = SigninPickerBinding.inflate(layoutInflater) - var accountListView: ListView = binding.pickerList - binding.isLand = (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE).also { - if (it) { - accountListView = binding.pickerListLand - } - } binding.appName = packageManager.getApplicationLabel(packageName).toString() binding.appIcon = packageManager.getApplicationIcon(packageName) val accounts = getSystemService()!!.getAccountsByType(DEFAULT_ACCOUNT_TYPE) + Account(DEFAULT_ACCOUNT, DEFAULT_ACCOUNT_TYPE) - accountListView.adapter = object : ArrayAdapter(this, 0, accounts) { + binding.pickerList.adapter = object : ArrayAdapter(this, 0, accounts) { override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val v = convertView ?: layoutInflater.inflate(R.layout.signin_account_row, parent, false) getItem(position)?.let { bindAccountRow(v, it) { _, _ -> notifyDataSetChanged() } } return v } } - accountListView.setOnItemClickListener { parent, view, position, id -> + binding.pickerList.setOnItemClickListener { parent, view, position, id -> binding.listProgressSpinner = true if (accounts[position].name == DEFAULT_ACCOUNT) { openAddAccount() diff --git a/play-services-core/src/main/res/layout-land/signin_picker.xml b/play-services-core/src/main/res/layout-land/signin_picker.xml new file mode 100644 index 000000000..87a2038ab --- /dev/null +++ b/play-services-core/src/main/res/layout-land/signin_picker.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/play-services-core/src/main/res/layout/signin_picker.xml b/play-services-core/src/main/res/layout/signin_picker.xml index a9d482497..3ba9dad81 100644 --- a/play-services-core/src/main/res/layout/signin_picker.xml +++ b/play-services-core/src/main/res/layout/signin_picker.xml @@ -25,101 +25,56 @@ name="listProgressSpinner" type="boolean" /> - - - - - - - - - - - - - - - - - - - - + + + + + + android:layout_marginTop="24dp" + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1"> @@ -132,5 +87,15 @@ + + \ No newline at end of file