1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 20:10:15 +02:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractListActivity.java
Andreas Shimokawa 29a05f1d8f refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic
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...
2018-03-31 16:21:25 +02:00

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);
}
}