Skip to content

Commit 2fa2c21

Browse files
remove unnecessary code
1 parent 7131ce3 commit 2fa2c21

2 files changed

Lines changed: 0 additions & 31 deletions

File tree

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
package jp.dosukoi.ui.view.common
22

3-
import android.app.Activity
43
import android.content.Context
5-
import android.content.Intent
6-
import android.net.Uri
74
import android.widget.Toast
8-
import androidx.annotation.StringRes
95
import jp.dosukoi.ui.view.R
106
import retrofit2.HttpException
117
import java.io.IOException
128

13-
fun Activity.showToast(message: String) {
14-
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
15-
}
16-
17-
fun Activity.showToast(@StringRes messageResId: Int) {
18-
val message = getString(messageResId)
19-
20-
showToast(message)
21-
}
22-
239
fun Context.showErrorToast(throwable: Throwable) {
2410
val message = when (throwable) {
2511
is IOException -> getString(R.string.io_exception)
@@ -31,8 +17,3 @@ fun Context.showErrorToast(throwable: Throwable) {
3117
}
3218
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
3319
}
34-
35-
fun Activity.navigateChrome(url: String) {
36-
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
37-
startActivity(intent)
38-
}

ui/view/src/main/java/jp/dosukoi/ui/view/top/MainActivity.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import coil.compose.LocalImageLoader
1111
import dagger.hilt.android.AndroidEntryPoint
1212
import jp.dosukoi.ui.view.common.CompositionLocalProvider
1313
import jp.dosukoi.ui.view.common.appColors
14-
import jp.dosukoi.ui.view.common.showErrorToast
1514
import jp.dosukoi.ui.viewmodel.myPage.MyPageViewModel
1615
import jp.dosukoi.ui.viewmodel.search.SearchViewModel
1716
import javax.inject.Inject
@@ -47,17 +46,6 @@ class MainActivity : AppCompatActivity() {
4746
myPageViewModel.init()
4847
}
4948

50-
private fun handleEvent(event: MainViewModel.Event) {
51-
when (event) {
52-
MainViewModel.Event.CompleteGetAccessToken -> {
53-
myPageViewModel.onRetryClick()
54-
}
55-
is MainViewModel.Event.FailedFetch -> {
56-
showErrorToast(event.throwable)
57-
}
58-
}
59-
}
60-
6149
override fun onNewIntent(intent: Intent?) {
6250
super.onNewIntent(intent)
6351
val action = intent?.action

0 commit comments

Comments
 (0)