diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e7b3156d..a68761b1e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -95,6 +95,10 @@ android:name=".activities.charts.ChartsPreferencesActivity" android:label="@string/activity_prefs_charts" android:parentActivityName=".activities.charts.ChartsPreferencesActivity" /> + . */ +package nodomain.freeyourgadget.gadgetbridge.activities; + +import android.os.Bundle; + +import nodomain.freeyourgadget.gadgetbridge.R; + +public class DiscoveryPairingPreferenceActivity extends AbstractSettingsActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.discovery_pairing_preferences); + } + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java index 4c249c9ec..b8a590671 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java @@ -394,6 +394,15 @@ public class SettingsActivity extends AbstractSettingsActivity { return true; } }); + pref = findPreference("pref_discovery_pairing"); + pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + public boolean onPreferenceClick(Preference preference) { + Intent enableIntent = new Intent(SettingsActivity.this, DiscoveryPairingPreferenceActivity.class); + startActivity(enableIntent); + return true; + } + }); + } @Override diff --git a/app/src/main/res/layout/activity_discovery.xml b/app/src/main/res/layout/activity_discovery.xml index 331bc9e2e..58d4cabdd 100644 --- a/app/src/main/res/layout/activity_discovery.xml +++ b/app/src/main/res/layout/activity_discovery.xml @@ -89,5 +89,10 @@ android:textColor="@color/secondarytext" android:textIsSelectable="true" /> +