diff --git a/app/src/main/kotlin/jackall/moncalc/viewmodel/MainViewModel.kt b/app/src/main/kotlin/jackall/moncalc/viewmodel/MainViewModel.kt index 2c80d71..90a4d82 100644 --- a/app/src/main/kotlin/jackall/moncalc/viewmodel/MainViewModel.kt +++ b/app/src/main/kotlin/jackall/moncalc/viewmodel/MainViewModel.kt @@ -6,6 +6,7 @@ import android.content.Intent import android.databinding.ObservableField import android.view.View +import jackall.moncalc.R import jackall.moncalc.service.MainService import jackall.moncalc.utils.ServiceUtil.Companion.isMainServiceRunning @@ -24,9 +25,9 @@ init { if (isMainServiceRunning(context)) { - serviceButtonText.set("常駐終了") + serviceButtonText.set(context.resources.getResourceName(R.string.start_service)) } else { - serviceButtonText.set("常駐開始") + serviceButtonText.set(context.resources.getResourceName(R.string.stop_service)) } } @@ -39,10 +40,10 @@ fun onClickServiceButton(view: View) { if (!isMainServiceRunning(context)) { context.startService(serviceIntent) - serviceButtonText.set("常駐終了") + serviceButtonText.set(context.resources.getResourceName(R.string.stop_service)) } else { context.stopService(serviceIntent) - serviceButtonText.set("常駐開始") + serviceButtonText.set(context.resources.getResourceName(R.string.start_service)) } } } \ No newline at end of file