fixed NPE
This commit is contained in:
parent
01ccd4d60a
commit
756c1aec97
|
@ -283,7 +283,10 @@ class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, Mult
|
|||
TAG_EDIT_TAB -> {
|
||||
tab = arguments.getParcelable(EXTRA_OBJECT)
|
||||
tabType = tab.type
|
||||
conf = TabConfiguration.ofType(tabType)!!
|
||||
conf = TabConfiguration.ofType(tabType) ?: run {
|
||||
dismiss()
|
||||
return
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
throw AssertionError()
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.content.Intent
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import kotlinx.android.synthetic.main.layout_extra_config_user.view.*
|
||||
import kotlinx.android.synthetic.main.list_item_simple_user.view.*
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.activity.UserListSelectorActivity
|
||||
import org.mariotaku.twidere.constant.IntentConstants.*
|
||||
|
@ -44,8 +46,8 @@ class UserExtraConfiguration(key: String) : TabConfiguration.ExtraConfiguration(
|
|||
intent.setClass(context, UserListSelectorActivity::class.java)
|
||||
fragment.startExtraConfigurationActivityForResult(this@UserExtraConfiguration, intent, 1)
|
||||
}
|
||||
hintView = view.findViewById(R.id.selectUserHint)
|
||||
viewHolder = TwoLineWithIconViewHolder(view.findViewById(R.id.listItem))
|
||||
hintView = view.selectUserHint
|
||||
viewHolder = TwoLineWithIconViewHolder(view.listItem)
|
||||
|
||||
viewHolder.view.visibility = View.GONE
|
||||
hintView.visibility = View.VISIBLE
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.content.Intent
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import kotlinx.android.synthetic.main.layout_extra_config_user_list.view.*
|
||||
import kotlinx.android.synthetic.main.list_item_simple_user_list.view.*
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.activity.UserListSelectorActivity
|
||||
import org.mariotaku.twidere.constant.IntentConstants.*
|
||||
|
@ -44,8 +46,8 @@ class UserListExtraConfiguration(key: String) : TabConfiguration.ExtraConfigurat
|
|||
intent.setClass(context, UserListSelectorActivity::class.java)
|
||||
fragment.startExtraConfigurationActivityForResult(this@UserListExtraConfiguration, intent, 1)
|
||||
}
|
||||
hintView = view.findViewById(R.id.selectUserHint)
|
||||
viewHolder = SimpleUserListViewHolder(view.findViewById(R.id.listItem))
|
||||
hintView = view.selectUserListHint
|
||||
viewHolder = SimpleUserListViewHolder(view.listItem)
|
||||
|
||||
viewHolder.itemView.visibility = View.GONE
|
||||
hintView.visibility = View.VISIBLE
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/listItem"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in New Issue