Compare commits
No commits in common. "a6777d1d1780a157cc0d8e31bc5aad5bcc072d93" and "4a32f53c0661c91a86a094cf1b61a2eb64df769e" have entirely different histories.
a6777d1d17
...
4a32f53c06
6 changed files with 5 additions and 53 deletions
|
@ -19,9 +19,6 @@ import android.widget.PopupMenu
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import androidx.core.view.updateLayoutParams
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -79,21 +76,6 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
||||||
fab = view.requireViewById(R.id.fab)
|
fab = view.requireViewById(R.id.fab)
|
||||||
profileList = view.requireViewById(R.id.profile_list)
|
profileList = view.requireViewById(R.id.profile_list)
|
||||||
|
|
||||||
val origFabMarginRight = (fab.layoutParams as ViewGroup.MarginLayoutParams).rightMargin
|
|
||||||
val origFabMarginBottom = (fab.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(fab) { v, insets ->
|
|
||||||
val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
||||||
|
|
||||||
v.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
||||||
rightMargin = origFabMarginRight + bars.right
|
|
||||||
bottomMargin = origFabMarginBottom + bars.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
WindowInsetsCompat.CONSUMED
|
|
||||||
}
|
|
||||||
|
|
||||||
setupRootViewInsets(profileList)
|
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,6 @@ class LogsActivity : AppCompatActivity() {
|
||||||
scrollView = requireViewById(R.id.scroll_view)
|
scrollView = requireViewById(R.id.scroll_view)
|
||||||
logText = requireViewById(R.id.log_text)
|
logText = requireViewById(R.id.log_text)
|
||||||
|
|
||||||
setupRootViewInsets(scrollView)
|
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener {
|
swipeRefresh.setOnRefreshListener {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
reload()
|
reload()
|
||||||
|
|
|
@ -42,17 +42,15 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
|
||||||
setSupportActionBar(requireViewById(R.id.toolbar))
|
setSupportActionBar(requireViewById(R.id.toolbar))
|
||||||
setupToolbarInsets()
|
setupToolbarInsets()
|
||||||
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
swipeRefresh = requireViewById(R.id.swipe_refresh)
|
|
||||||
notificationList = requireViewById(R.id.recycler_view)
|
|
||||||
|
|
||||||
setupRootViewInsets(notificationList)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onInit() {
|
override fun onInit() {
|
||||||
euiccChannel = euiccChannelManager
|
euiccChannel = euiccChannelManager
|
||||||
.findEuiccChannelBySlotBlocking(intent.getIntExtra("logicalSlotId", 0))!!
|
.findEuiccChannelBySlotBlocking(intent.getIntExtra("logicalSlotId", 0))!!
|
||||||
|
|
||||||
|
swipeRefresh = requireViewById(R.id.swipe_refresh)
|
||||||
|
notificationList = requireViewById(R.id.recycler_view)
|
||||||
|
|
||||||
notificationList.layoutManager =
|
notificationList.layoutManager =
|
||||||
LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||||
notificationList.addItemDecoration(DividerItemDecoration(this, LinearLayoutManager.VERTICAL))
|
notificationList.addItemDecoration(DividerItemDecoration(this, LinearLayoutManager.VERTICAL))
|
||||||
|
|
|
@ -3,9 +3,6 @@ package im.angry.openeuicc.ui
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.datastore.preferences.core.Preferences
|
import androidx.datastore.preferences.core.Preferences
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.CheckBoxPreference
|
import androidx.preference.CheckBoxPreference
|
||||||
|
@ -49,14 +46,6 @@ class SettingsFragment: PreferenceFragmentCompat() {
|
||||||
?.bindBooleanFlow(preferenceRepository.disableSafeguardFlow, PreferenceKeys.DISABLE_SAFEGUARD_REMOVABLE_ESIM)
|
?.bindBooleanFlow(preferenceRepository.disableSafeguardFlow, PreferenceKeys.DISABLE_SAFEGUARD_REMOVABLE_ESIM)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View {
|
|
||||||
return super.onCreateView(inflater, container, savedInstanceState).also(::setupRootViewInsets)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun CheckBoxPreference.bindBooleanFlow(flow: Flow<Boolean>, key: Preferences.Key<Boolean>) {
|
private fun CheckBoxPreference.bindBooleanFlow(flow: Flow<Boolean>, key: Preferences.Key<Boolean>) {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
flow.collect { isChecked = it }
|
flow.collect { isChecked = it }
|
||||||
|
|
|
@ -52,20 +52,7 @@ fun AppCompatActivity.setupToolbarInsets() {
|
||||||
height = v.top
|
height = v.top
|
||||||
}
|
}
|
||||||
|
|
||||||
|
android.util.Log.d("aaa", "${(v as Toolbar).minimumHeight}")
|
||||||
WindowInsetsCompat.CONSUMED
|
WindowInsetsCompat.CONSUMED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setupRootViewInsets(view: View) {
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets ->
|
|
||||||
val bars = insets.getInsets(
|
|
||||||
WindowInsetsCompat.Type.systemBars()
|
|
||||||
or WindowInsetsCompat.Type.displayCutout()
|
|
||||||
)
|
|
||||||
|
|
||||||
// Don't set padding bottom because we do want scrolling root views to extend into nav bar
|
|
||||||
v.updatePadding(bars.left, v.paddingTop, bars.right, v.paddingBottom)
|
|
||||||
|
|
||||||
WindowInsetsCompat.CONSUMED
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -26,7 +26,7 @@ class CompatibilityCheckActivity: AppCompatActivity() {
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_compatibility_check)
|
setContentView(R.layout.activity_compatibility_check)
|
||||||
setSupportActionBar(requireViewById(im.angry.openeuicc.common.R.id.toolbar))
|
setSupportActionBar(requireViewById(R.id.toolbar))
|
||||||
setupToolbarInsets()
|
setupToolbarInsets()
|
||||||
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
|
@ -35,8 +35,6 @@ class CompatibilityCheckActivity: AppCompatActivity() {
|
||||||
LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||||
compatibilityCheckList.addItemDecoration(DividerItemDecoration(this, LinearLayoutManager.VERTICAL))
|
compatibilityCheckList.addItemDecoration(DividerItemDecoration(this, LinearLayoutManager.VERTICAL))
|
||||||
compatibilityCheckList.adapter = adapter
|
compatibilityCheckList.adapter = adapter
|
||||||
|
|
||||||
setupRootViewInsets(compatibilityCheckList)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue