Loading app/src/androidTest/java/at/bitfire/davdroid/ui/setup/DavResourceFinderTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class DavResourceFinderTest { server.start() val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as Application loginModel = LoginModel(application) loginModel = LoginModel() loginModel.baseURI = URI.create("/") loginModel.credentials = Credentials("mock", "12345") Loading app/src/main/java/at/bitfire/davdroid/model/CollectionDao.kt +5 −5 Original line number Diff line number Diff line Loading @@ -9,19 +9,19 @@ interface CollectionDao { @Query("SELECT * FROM collection WHERE id=:id") fun get(id: Long): Collection? @Query("SELECT * FROM collection WHERE serviceId=:serviceId") @Query("SELECT * FROM collection WHERE serviceId=:serviceId ORDER BY displayName, url") fun getByService(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync ORDER BY displayName, url") fun getByServiceAndSync(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type ORDER BY displayName, url") fun observeByServiceAndType(serviceId: Long, type: String): LiveData<List<Collection>> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVEVENT AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVEVENT AND sync ORDER BY displayName, url") fun getSyncCalendars(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVTODO AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVTODO AND sync ORDER BY displayName, url") fun getSyncTaskLists(serviceId: Long): List<Collection> @Insert(onConflict = OnConflictStrategy.REPLACE) Loading app/src/main/java/at/bitfire/davdroid/ui/setup/AccountDetailsFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class AccountDetailsFragment: Fragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { val v = LoginAccountDetailsBinding.inflate(inflater, container, false) v.lifecycleOwner = this v.lifecycleOwner = viewLifecycleOwner v.details = model val config = loginModel.configuration ?: throw IllegalStateException() Loading app/src/main/java/at/bitfire/davdroid/ui/setup/DefaultLoginCredentialsFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class DefaultLoginCredentialsFragment: Fragment() { loginModel = ViewModelProviders.of(requireActivity()).get(LoginModel::class.java) val v = LoginCredentialsFragmentBinding.inflate(inflater, container, false) v.lifecycleOwner = this v.lifecycleOwner = viewLifecycleOwner v.model = model // initialize model on first call Loading app/src/main/java/at/bitfire/davdroid/ui/setup/DefaultLoginCredentialsModel.kt +3 −2 Original line number Diff line number Diff line package at.bitfire.davdroid.ui.setup import android.content.Intent import androidx.annotation.MainThread import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel Loading Loading @@ -29,9 +30,11 @@ class DefaultLoginCredentialsModel: ViewModel() { loginWithEmailAddress.value = true } @MainThread fun initialize(intent: Intent) { if (initialized) return initialized = true // we've got initial login data val givenUrl = intent.getStringExtra(LoginActivity.EXTRA_URL) Loading @@ -46,8 +49,6 @@ class DefaultLoginCredentialsModel: ViewModel() { username.value = givenUsername } password.value = givenPassword initialized = true } } No newline at end of file Loading
app/src/androidTest/java/at/bitfire/davdroid/ui/setup/DavResourceFinderTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class DavResourceFinderTest { server.start() val application = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as Application loginModel = LoginModel(application) loginModel = LoginModel() loginModel.baseURI = URI.create("/") loginModel.credentials = Credentials("mock", "12345") Loading
app/src/main/java/at/bitfire/davdroid/model/CollectionDao.kt +5 −5 Original line number Diff line number Diff line Loading @@ -9,19 +9,19 @@ interface CollectionDao { @Query("SELECT * FROM collection WHERE id=:id") fun get(id: Long): Collection? @Query("SELECT * FROM collection WHERE serviceId=:serviceId") @Query("SELECT * FROM collection WHERE serviceId=:serviceId ORDER BY displayName, url") fun getByService(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync ORDER BY displayName, url") fun getByServiceAndSync(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type ORDER BY displayName, url") fun observeByServiceAndType(serviceId: Long, type: String): LiveData<List<Collection>> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVEVENT AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVEVENT AND sync ORDER BY displayName, url") fun getSyncCalendars(serviceId: Long): List<Collection> @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVTODO AND sync") @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND supportsVTODO AND sync ORDER BY displayName, url") fun getSyncTaskLists(serviceId: Long): List<Collection> @Insert(onConflict = OnConflictStrategy.REPLACE) Loading
app/src/main/java/at/bitfire/davdroid/ui/setup/AccountDetailsFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class AccountDetailsFragment: Fragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { val v = LoginAccountDetailsBinding.inflate(inflater, container, false) v.lifecycleOwner = this v.lifecycleOwner = viewLifecycleOwner v.details = model val config = loginModel.configuration ?: throw IllegalStateException() Loading
app/src/main/java/at/bitfire/davdroid/ui/setup/DefaultLoginCredentialsFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class DefaultLoginCredentialsFragment: Fragment() { loginModel = ViewModelProviders.of(requireActivity()).get(LoginModel::class.java) val v = LoginCredentialsFragmentBinding.inflate(inflater, container, false) v.lifecycleOwner = this v.lifecycleOwner = viewLifecycleOwner v.model = model // initialize model on first call Loading
app/src/main/java/at/bitfire/davdroid/ui/setup/DefaultLoginCredentialsModel.kt +3 −2 Original line number Diff line number Diff line package at.bitfire.davdroid.ui.setup import android.content.Intent import androidx.annotation.MainThread import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel Loading Loading @@ -29,9 +30,11 @@ class DefaultLoginCredentialsModel: ViewModel() { loginWithEmailAddress.value = true } @MainThread fun initialize(intent: Intent) { if (initialized) return initialized = true // we've got initial login data val givenUrl = intent.getStringExtra(LoginActivity.EXTRA_URL) Loading @@ -46,8 +49,6 @@ class DefaultLoginCredentialsModel: ViewModel() { username.value = givenUsername } password.value = givenPassword initialized = true } } No newline at end of file