mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-12 18:57:36 +01:00
Made items in the media receivers list more differentiable
This commit is contained in:
parent
701039e673
commit
22256030b5
@ -46,18 +46,20 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsPreferencesActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.PeriodicExporter;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandPreferencesActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.ConfigActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimePreferenceActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsPreferencesActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
|
||||
@ -392,8 +394,14 @@ public class SettingsActivity extends AbstractSettingsActivity {
|
||||
newValues[0] = "default";
|
||||
|
||||
int i = 1;
|
||||
Set<String> existingNames = new HashSet<>();
|
||||
for (ResolveInfo resolveInfo : mediaReceivers) {
|
||||
newEntries[i] = resolveInfo.activityInfo.loadLabel(pm);
|
||||
newEntries[i] = resolveInfo.activityInfo.loadLabel(pm) + " (" + resolveInfo.activityInfo.packageName + ")";
|
||||
if (existingNames.contains(newEntries[i].toString().trim())) {
|
||||
newEntries[i] = resolveInfo.activityInfo.loadLabel(pm) + " (" + resolveInfo.activityInfo.name + ")";
|
||||
} else {
|
||||
existingNames.add(newEntries[i].toString().trim());
|
||||
}
|
||||
newValues[i] = resolveInfo.activityInfo.packageName;
|
||||
i++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user