From 27113a530fa0804550e221c7a27cd80ae9e5c136 Mon Sep 17 00:00:00 2001 From: norangebit Date: Thu, 12 Dec 2019 19:31:38 +0100 Subject: [PATCH] fix formatting --- .../ding/ids/wedroid/app/data/dao/BoardDaoTest.kt | 7 +------ .../unisannio/ding/ids/wedroid/app/data/dao/BoardDao.kt | 8 ++++++-- .../unisannio/ding/ids/wedroid/app/data/entity/Board.kt | 1 - .../ids/wedroid/app/data/repository/BoardRepository.kt | 1 - .../ding/ids/wedroid/app/util/ServicesFactory.kt | 9 +++++++-- .../ding/ids/wedroid/app/util/SharedPreferenceHelper.kt | 7 +++---- .../ding/ids/wedroid/app/view/BoardsListsActivity.kt | 3 +-- .../unisannio/ding/ids/wedroid/app/view/LoginActivity.kt | 4 ---- .../ids/wedroid/app/view/adapter/BoardsListAdapter.kt | 1 - .../java/it/unisannio/ding/ids/wedroid/app/TestHelper.kt | 1 - 10 files changed, 18 insertions(+), 24 deletions(-) diff --git a/app/src/androidTest/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDaoTest.kt b/app/src/androidTest/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDaoTest.kt index 2655621..e6151bb 100644 --- a/app/src/androidTest/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDaoTest.kt +++ b/app/src/androidTest/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDaoTest.kt @@ -17,7 +17,6 @@ import org.junit.Test import org.junit.runner.RunWith import java.io.IOException - @RunWith(AndroidJUnit4::class) class BoardDaoTest { private lateinit var dao: BoardDao @@ -108,8 +107,4 @@ class BoardDaoTest { assertEquals(0, it.size) } } -} - - - - +} \ No newline at end of file diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDao.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDao.kt index ca88fa4..adcfa85 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDao.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/dao/BoardDao.kt @@ -1,7 +1,11 @@ package it.unisannio.ding.ids.wedroid.app.data.dao import androidx.lifecycle.LiveData -import androidx.room.* +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import it.unisannio.ding.ids.wedroid.app.data.entity.Board @Dao @@ -14,4 +18,4 @@ interface BoardDao { @Delete suspend fun delete(board: Board) -} \ No newline at end of file +} diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/entity/Board.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/entity/Board.kt index 0cd1f70..eb61071 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/entity/Board.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/entity/Board.kt @@ -13,4 +13,3 @@ data class Board( fun it.unisannio.ding.ids.wedroid.wrapper.entity.Board.convert(): Board { return Board(this.id, this.title) } - diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/repository/BoardRepository.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/repository/BoardRepository.kt index 204940d..1218371 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/repository/BoardRepository.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/data/repository/BoardRepository.kt @@ -159,4 +159,3 @@ class BoardRepository( Log.e("RETROFIT", message) } } - diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/ServicesFactory.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/ServicesFactory.kt index b64032e..eece43a 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/ServicesFactory.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/ServicesFactory.kt @@ -1,6 +1,12 @@ package it.unisannio.ding.ids.wedroid.app.util -import it.unisannio.ding.ids.wedroid.wrapper.api.* +import it.unisannio.ding.ids.wedroid.wrapper.api.BoardService +import it.unisannio.ding.ids.wedroid.wrapper.api.CardCommentService +import it.unisannio.ding.ids.wedroid.wrapper.api.CardService +import it.unisannio.ding.ids.wedroid.wrapper.api.ChecklistService +import it.unisannio.ding.ids.wedroid.wrapper.api.ListService +import it.unisannio.ding.ids.wedroid.wrapper.api.SwimlanesService +import it.unisannio.ding.ids.wedroid.wrapper.api.UserService import okhttp3.OkHttpClient import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory @@ -75,4 +81,3 @@ class ServicesFactory private constructor( } } } - diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/SharedPreferenceHelper.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/SharedPreferenceHelper.kt index 2f150c8..9f4f37d 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/SharedPreferenceHelper.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/util/SharedPreferenceHelper.kt @@ -2,7 +2,7 @@ package it.unisannio.ding.ids.wedroid.app.util import android.content.Context -class SharedPreferenceHelper(context : Context) : PreferenceReader, PreferenceWriter { +class SharedPreferenceHelper(context: Context) : PreferenceReader, PreferenceWriter { private val sp = context.getSharedPreferences("userinfo", Context.MODE_PRIVATE) override fun getBaseUrl(): String? { @@ -20,8 +20,7 @@ class SharedPreferenceHelper(context : Context) : PreferenceReader, PreferenceWr override fun setBaseUrl(baseUrl: String?) { val editor = sp.edit() editor.putString("url", baseUrl).apply() - - } + } override fun setUserId(userId: String?) { val editor = sp.edit() @@ -32,4 +31,4 @@ class SharedPreferenceHelper(context : Context) : PreferenceReader, PreferenceWr val editor = sp.edit() editor.putString("token", token).apply() } -} \ No newline at end of file +} diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/BoardsListsActivity.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/BoardsListsActivity.kt index b67f7b6..f5be060 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/BoardsListsActivity.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/BoardsListsActivity.kt @@ -118,7 +118,7 @@ class BoardsListsActivity : AppCompatActivity() { val isPrivate = data.getBooleanExtra(NewBoardActivity.BOARD_PRIVATE, true) - viewModel.insertBoard(title, isPrivate, BoardBackgroundColor.LIMEGREEN) //TODO + viewModel.insertBoard(title, isPrivate, BoardBackgroundColor.LIMEGREEN) // TODO } companion object { @@ -126,4 +126,3 @@ class BoardsListsActivity : AppCompatActivity() { const val LOGIN_CODE = 19 } } - diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/LoginActivity.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/LoginActivity.kt index d3a15bf..222dd8b 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/LoginActivity.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/LoginActivity.kt @@ -37,7 +37,6 @@ class LoginActivity : AppCompatActivity() { return } - val userNameText = username.text.toString() val passwordText = password.text.toString() @@ -47,8 +46,6 @@ class LoginActivity : AppCompatActivity() { .build() .create(LoginService::class.java) - - service.login(userNameText, passwordText).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { Toast.makeText( @@ -82,7 +79,6 @@ class LoginActivity : AppCompatActivity() { setResult(LOGIN_OK) finish() } - }) } diff --git a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/adapter/BoardsListAdapter.kt b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/adapter/BoardsListAdapter.kt index 56d5ddb..f4fb929 100644 --- a/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/adapter/BoardsListAdapter.kt +++ b/app/src/main/java/it/unisannio/ding/ids/wedroid/app/view/adapter/BoardsListAdapter.kt @@ -9,7 +9,6 @@ import androidx.recyclerview.widget.RecyclerView import it.unisannio.ding.ids.wedroid.app.R import it.unisannio.ding.ids.wedroid.app.data.entity.Board - class BoardsListAdapter internal constructor( context: Context ) : RecyclerView.Adapter() { diff --git a/app/src/test/java/it/unisannio/ding/ids/wedroid/app/TestHelper.kt b/app/src/test/java/it/unisannio/ding/ids/wedroid/app/TestHelper.kt index 42a2ada..f2a68ee 100644 --- a/app/src/test/java/it/unisannio/ding/ids/wedroid/app/TestHelper.kt +++ b/app/src/test/java/it/unisannio/ding/ids/wedroid/app/TestHelper.kt @@ -10,4 +10,3 @@ fun getPrivateFun(name: String, kClass: KClass<*>): KFunction<*>? { .find { it.name == name } .also { it?.isAccessible = true } } -