|
|
@ -78,6 +78,15 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onAttached() { |
|
|
|
|
|
|
|
super.onAttached() |
|
|
|
|
|
|
|
val fragment = |
|
|
|
|
|
|
|
getActivity()?.supportFragmentManager?.findFragmentByTag(getFragmentTag()) as IconDialog? |
|
|
|
|
|
|
|
fragment?.onChanged = { value -> |
|
|
|
|
|
|
|
this@IconListPreference.value = value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun getActivity(): FragmentActivity? { |
|
|
|
private fun getActivity(): FragmentActivity? { |
|
|
|
val context = context |
|
|
|
val context = context |
|
|
|
if (context is FragmentActivity) { |
|
|
|
if (context is FragmentActivity) { |
|
|
@ -91,7 +100,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference |
|
|
|
return null |
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getFragmentTag(): String { |
|
|
|
private fun getFragmentTag(): String { |
|
|
|
return "icon_$key" |
|
|
|
return "icon_$key" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|