Enable R8 and fix errors.

pull/127/head
Tom Hacohen 4 years ago
parent cf2198b1b8
commit c90bf78dc5

@ -47,7 +47,7 @@ class AccountListFragment : ListFragment(), LoaderManager.LoaderCallbacks<Array<
}
override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) {
val account = listAdapter.getItem(position) as Account
val account = listAdapter?.getItem(position) as Account
val intent = Intent(context, AccountActivity::class.java)
intent.putExtra(AccountActivity.EXTRA_ACCOUNT, account)

@ -104,7 +104,7 @@ class CollectionMembersListFragment : ListFragment(), AdapterView.OnItemClickLis
}
override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) {
val member = listAdapter.getItem(position) as JournalManager.Member
val member = listAdapter?.getItem(position) as JournalManager.Member
AlertDialog.Builder(activity!!)
.setIcon(R.drawable.ic_info_dark)

@ -103,7 +103,7 @@ class ImportActivity : BaseActivity(), SelectImportMethod, ResultFragment.OnImpo
private var mSelectImportMethod: SelectImportMethod? = null
override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
super.onAttach(context)
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
@ -115,14 +115,14 @@ class ImportActivity : BaseActivity(), SelectImportMethod, ResultFragment.OnImpo
}
override fun onAttach(activity: Activity?) {
override fun onAttach(activity: Activity) {
super.onAttach(activity)
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
mSelectImportMethod = activity as SelectImportMethod?
} catch (e: ClassCastException) {
throw ClassCastException(activity!!.toString() + " must implement MyInterface ")
throw ClassCastException(activity.toString() + " must implement MyInterface ")
}
}

@ -22,7 +22,7 @@ class ResultFragment : DialogFragment() {
result = arguments!!.getSerializable(KEY_RESULT) as ImportResult
}
override fun onDismiss(dialog: DialogInterface?) {
override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
val activity = activity
if (activity is DialogInterface) {

@ -87,7 +87,7 @@ class ListEntriesFragment : ListFragment(), AdapterView.OnItemClickListener {
}
override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) {
val entry = listAdapter.getItem(position) as EntryEntity
val entry = listAdapter?.getItem(position) as EntryEntity
startActivity(JournalItemActivity.newIntent(context!!, account, info, entry.content))
}

@ -1,4 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
android.enableR8 = false
org.gradle.jvmargs=-Xmx2048M

Loading…
Cancel
Save