mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-28 16:00:12 +02:00
29a05f1d8f
This removes misuse of testNewFunctionality() and support fetching GPS data and debug logs Fetching debug logs (Amazfit Bip/Cor) is now accessible in the debug activity Fetching GPS data can be done by swiping in the list activity. TODO: actually refresh list when fetching data is done :P Also fix some android studio warnings on the go...
38 lines
1.0 KiB
Java
38 lines
1.0 KiB
Java
package nodomain.freeyourgadget.gadgetbridge.activities;
|
|
|
|
import android.os.Bundle;
|
|
import android.widget.ListView;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
|
import nodomain.freeyourgadget.gadgetbridge.adapter.AbstractItemAdapter;
|
|
|
|
public abstract class AbstractListActivity<T> extends AbstractGBActivity {
|
|
private AbstractItemAdapter<T> itemAdapter;
|
|
private ListView itemListView;
|
|
|
|
public void setItemAdapter(AbstractItemAdapter<T> itemAdapter) {
|
|
this.itemAdapter = itemAdapter;
|
|
itemListView.setAdapter(itemAdapter);
|
|
}
|
|
|
|
protected void refresh() {
|
|
this.itemAdapter.loadItems();
|
|
}
|
|
|
|
public AbstractItemAdapter<T> getItemAdapter() {
|
|
return itemAdapter;
|
|
}
|
|
|
|
public ListView getItemListView() {
|
|
return itemListView;
|
|
}
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_list);
|
|
itemListView = findViewById(R.id.itemListView);
|
|
}
|
|
}
|