mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-07 01:06:57 +02:00
show Bluetooth information what is supported and what is not
This commit is contained in:
@@ -23,6 +23,7 @@ import android.preference.MultiSelectListPreference;
|
|||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
|
import android.text.Html;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
|
|
||||||
@@ -31,12 +32,21 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class BluetoothPreferences extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class BluetoothPreferences extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
String[] btDeviceSupportInit;
|
||||||
|
String[] btDeviceSupportDataTransfer;
|
||||||
|
String[] btDeviceSupportDataHistory;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.bluetooth_preferences);
|
addPreferencesFromResource(R.xml.bluetooth_preferences);
|
||||||
|
|
||||||
|
btDeviceSupportInit = getResources().getStringArray(R.array.bt_device_support_initializing);
|
||||||
|
btDeviceSupportDataTransfer = getResources().getStringArray(R.array.bt_device_support_data_transfer);
|
||||||
|
btDeviceSupportDataHistory = getResources().getStringArray(R.array.bt_device_support_data_history);
|
||||||
|
|
||||||
initSummary(getPreferenceScreen());
|
initSummary(getPreferenceScreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +82,15 @@ public class BluetoothPreferences extends PreferenceFragment implements SharedPr
|
|||||||
private void updatePrefSummary(Preference p) {
|
private void updatePrefSummary(Preference p) {
|
||||||
if (p instanceof ListPreference) {
|
if (p instanceof ListPreference) {
|
||||||
ListPreference listPref = (ListPreference) p;
|
ListPreference listPref = (ListPreference) p;
|
||||||
p.setSummary(listPref.getEntry());
|
|
||||||
|
int i = Integer.parseInt(listPref.getValue());
|
||||||
|
|
||||||
|
p.setSummary(Html.fromHtml(listPref.getEntry() + "<br>" +
|
||||||
|
getResources().getString(R.string.label_bt_device_support) + ":" + "<br>" +
|
||||||
|
getResources().getString(R.string.label_bt_device_initialization) + ": " + btDeviceSupportInit[i] + "<br>" +
|
||||||
|
getResources().getString(R.string.label_bt_device_data_transfer) + ": " + btDeviceSupportDataTransfer[i] + "<br>" +
|
||||||
|
getResources().getString(R.string.label_bt_device_data_history) + ": " + btDeviceSupportDataHistory[i]
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p instanceof EditTextPreference) {
|
if (p instanceof EditTextPreference) {
|
||||||
|
@@ -117,4 +117,8 @@
|
|||||||
<string name="error_value_required">Wert ist erforderlich</string>
|
<string name="error_value_required">Wert ist erforderlich</string>
|
||||||
<string name="title_statistics">Statistiken</string>
|
<string name="title_statistics">Statistiken</string>
|
||||||
<string name="label_cancel">Abbrechen</string>
|
<string name="label_cancel">Abbrechen</string>
|
||||||
|
<string name="label_bt_device_data_history">Bt Waage Datenhistorie</string>
|
||||||
|
<string name="label_bt_device_data_transfer">Bt Waage Datentransfer</string>
|
||||||
|
<string name="label_bt_device_initialization">Bt Waage Initialisierung</string>
|
||||||
|
<string name="label_bt_device_support">Folgendes wird unterstützt</string>
|
||||||
</resources>
|
</resources>
|
@@ -136,4 +136,8 @@
|
|||||||
<string name="Friday">Friday</string>
|
<string name="Friday">Friday</string>
|
||||||
<string name="Saturday">Saturday</string>
|
<string name="Saturday">Saturday</string>
|
||||||
<string name="Sunday">Sunday</string>
|
<string name="Sunday">Sunday</string>
|
||||||
|
<string name="label_bt_device_initialization">Bt scale initialization</string>
|
||||||
|
<string name="label_bt_device_data_transfer">Bt scale data transfer</string>
|
||||||
|
<string name="label_bt_device_data_history">Bt scale data history</string>
|
||||||
|
<string name="label_bt_device_support">Following will supported</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -11,4 +11,23 @@
|
|||||||
<item>1</item>
|
<item>1</item>
|
||||||
<item>2</item>
|
<item>2</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="bt_device_support_initializing">
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_no</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="bt_device_support_data_transfer">
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="bt_device_support_data_history">
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_yes</item>
|
||||||
|
<item>@string/label_no</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Reference in New Issue
Block a user