From d1768ea8b4b409f79cd525758f2c1552dac7bd4a Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 24 Sep 2016 18:56:52 +0900 Subject: [PATCH] Removed exit button, made app always run on device start --- android/src/main/res/menu/main.xml | 4 ---- android/src/main/res/values/strings.xml | 6 ------ android/src/main/res/xml/settings.xml | 4 ---- .../com/nutomic/ensichat/fragments/ContactsFragment.scala | 8 -------- .../scala/com/nutomic/ensichat/service/BootReceiver.scala | 4 +--- 5 files changed, 1 insertion(+), 25 deletions(-) diff --git a/android/src/main/res/menu/main.xml b/android/src/main/res/menu/main.xml index 6779ed6..3cf3483 100644 --- a/android/src/main/res/menu/main.xml +++ b/android/src/main/res/menu/main.xml @@ -14,8 +14,4 @@ android:id="@+id/settings" android:title="@string/settings" /> - - diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml index c3085e7..01ea7ad 100644 --- a/android/src/main/res/values/strings.xml +++ b/android/src/main/res/values/strings.xml @@ -41,9 +41,6 @@ Share App - - Exit - @@ -93,9 +90,6 @@ Scan Interval (seconds) - - Start on Boot - Notification Sounds diff --git a/android/src/main/res/xml/settings.xml b/android/src/main/res/xml/settings.xml index 286363f..9d1ac4e 100644 --- a/android/src/main/res/xml/settings.xml +++ b/android/src/main/res/xml/settings.xml @@ -12,10 +12,6 @@ android:key="user_status" android:inputType="textCapSentences" /> - - diff --git a/android/src/main/scala/com/nutomic/ensichat/fragments/ContactsFragment.scala b/android/src/main/scala/com/nutomic/ensichat/fragments/ContactsFragment.scala index 150350f..2e47bfc 100644 --- a/android/src/main/scala/com/nutomic/ensichat/fragments/ContactsFragment.scala +++ b/android/src/main/scala/com/nutomic/ensichat/fragments/ContactsFragment.scala @@ -110,14 +110,6 @@ class ContactsFragment extends ListFragment with OnClickListener { case R.id.settings => startActivity(new Intent(getActivity, classOf[SettingsActivity])) true - case R.id.exit => - val pm = PreferenceManager.getDefaultSharedPreferences(getActivity) - if (!pm.getBoolean(MainActivity.PrefWasBluetoothEnabled, false)) - BluetoothAdapter.getDefaultAdapter.disable() - - getActivity.stopService(new Intent(getActivity, classOf[ChatService])) - getActivity.finish() - true case _ => super.onOptionsItemSelected(item) } diff --git a/android/src/main/scala/com/nutomic/ensichat/service/BootReceiver.scala b/android/src/main/scala/com/nutomic/ensichat/service/BootReceiver.scala index 7673a66..93e2b3a 100644 --- a/android/src/main/scala/com/nutomic/ensichat/service/BootReceiver.scala +++ b/android/src/main/scala/com/nutomic/ensichat/service/BootReceiver.scala @@ -10,9 +10,7 @@ class BootReceiver extends BroadcastReceiver { override def onReceive(context: Context, intent: Intent): Unit = { val sp = PreferenceManager.getDefaultSharedPreferences(context) - if (sp.getBoolean("start_on_boot", false)) { - context.startService(new Intent(context, classOf[ChatService])) - } + context.startService(new Intent(context, classOf[ChatService])) } }