mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 03:12:15 +00:00
Clean up
This commit is contained in:
parent
132ae9b77d
commit
2dc3d8fae4
@ -6,9 +6,9 @@ import android.os.Parcel
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.FrameLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.looker.droidify.R
|
||||
import com.looker.droidify.content.Preferences
|
||||
import com.looker.droidify.database.CursorOwner
|
||||
@ -17,7 +17,7 @@ import com.looker.droidify.utility.KParcelable
|
||||
import com.looker.droidify.utility.extension.resources.getDrawableFromAttr
|
||||
import com.looker.droidify.utility.extension.text.nullIfEmpty
|
||||
|
||||
abstract class ScreenActivity : FragmentActivity() {
|
||||
abstract class ScreenActivity : AppCompatActivity() {
|
||||
companion object {
|
||||
private const val STATE_FRAGMENT_STACK = "fragmentStack"
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ class SettingsFragment : ScreenFragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val toolbar = view.findViewById<Toolbar>(R.id.toolbar)!!
|
||||
screenActivity.onToolbarCreated(toolbar)
|
||||
toolbar.setTitle(R.string.settings)
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
package com.looker.droidify.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.widget.LinearLayout
|
||||
|
||||
class FragmentLinearLayout : LinearLayout {
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
init {
|
||||
fitsSystemWindows = true
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
var percentTranslationY: Float
|
||||
get() = height.let { if (it > 0) translationY / it else 0f }
|
||||
set(value) {
|
||||
translationY = value * height
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package com.looker.droidify.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
|
||||
class Toolbar : Toolbar {
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private var initalized = false
|
||||
private var layoutDirectionChanged: Int? = null
|
||||
|
||||
init {
|
||||
initalized = true
|
||||
val layoutDirection = layoutDirectionChanged
|
||||
layoutDirectionChanged = null
|
||||
if (layoutDirection != null) onRtlPropertiesChanged(layoutDirection)
|
||||
}
|
||||
|
||||
override fun onRtlPropertiesChanged(layoutDirection: Int) {
|
||||
if (initalized) {
|
||||
super.onRtlPropertiesChanged(layoutDirection)
|
||||
} else {
|
||||
layoutDirectionChanged = layoutDirection
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user