mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Minor changes
This commit is contained in:
parent
03ede77bd1
commit
adb88560b5
@ -630,7 +630,7 @@ public class Device implements BaseLink.PackageReceiver {
|
||||
}
|
||||
|
||||
public boolean hasPluginsLoaded() {
|
||||
return !(plugins.isEmpty() && failedPlugins.isEmpty());
|
||||
return !plugins.isEmpty() || !failedPlugins.isEmpty();
|
||||
}
|
||||
|
||||
public void reloadPluginsFromSettings() {
|
||||
|
@ -9,11 +9,11 @@ import org.kde.kdeconnect_tp.R;
|
||||
public class SectionItem implements ListAdapter.Item {
|
||||
|
||||
private final String title;
|
||||
public boolean isEmpty;
|
||||
public boolean isSectionEmpty;
|
||||
|
||||
public SectionItem(String title) {
|
||||
this.title = title;
|
||||
this.isEmpty = false;
|
||||
this.isSectionEmpty = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -21,13 +21,14 @@ public class SectionItem implements ListAdapter.Item {
|
||||
|
||||
View v = layoutInflater.inflate(R.layout.list_item_category, null);
|
||||
|
||||
//Make it not selectable
|
||||
v.setOnClickListener(null);
|
||||
v.setOnLongClickListener(null);
|
||||
|
||||
TextView sectionView = (TextView) v.findViewById(R.id.list_item_category_text);
|
||||
sectionView.setText(title);
|
||||
|
||||
if (isEmpty) {
|
||||
if (isSectionEmpty) {
|
||||
v.findViewById(R.id.list_item_category_empty_placeholder).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -104,35 +104,35 @@ public class MainActivity extends ActionBarActivity {
|
||||
Resources res = getResources();
|
||||
|
||||
section = new SectionItem(res.getString(R.string.category_connected_devices));
|
||||
section.isEmpty = true;
|
||||
section.isSectionEmpty = true;
|
||||
items.add(section);
|
||||
for(Device d : devices) {
|
||||
if (d.isReachable() && d.isPaired()) {
|
||||
items.add(new DeviceItem(MainActivity.this, d));
|
||||
section.isEmpty = false;
|
||||
section.isSectionEmpty = false;
|
||||
}
|
||||
}
|
||||
|
||||
section = new SectionItem(res.getString(R.string.category_not_paired_devices));
|
||||
section.isEmpty = true;
|
||||
section.isSectionEmpty = true;
|
||||
items.add(section);
|
||||
for(Device d : devices) {
|
||||
if (d.isReachable() && !d.isPaired()) {
|
||||
items.add(new DeviceItem(MainActivity.this, d));
|
||||
section.isEmpty = false;
|
||||
section.isSectionEmpty = false;
|
||||
}
|
||||
}
|
||||
|
||||
section = new SectionItem(res.getString(R.string.category_remembered_devices));
|
||||
section.isEmpty = true;
|
||||
section.isSectionEmpty = true;
|
||||
items.add(section);
|
||||
for(Device d : devices) {
|
||||
if (!d.isReachable() && d.isPaired()) {
|
||||
items.add(new DeviceItem(MainActivity.this, d));
|
||||
section.isEmpty = false;
|
||||
section.isSectionEmpty = false;
|
||||
}
|
||||
}
|
||||
if (section.isEmpty) {
|
||||
if (section.isSectionEmpty) {
|
||||
items.remove(items.size()-1); //Remove remembered devices section if empty
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,8 @@ public class ShareToReceiver extends ActionBarActivity {
|
||||
queuedSendUriList(device, uriList);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(this.getClass().getName(), e.toString());
|
||||
e.printStackTrace();
|
||||
Log.e("ShareToReceiver", "Exception");
|
||||
}
|
||||
|
||||
} else if (extras.containsKey(Intent.EXTRA_TEXT)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user