Initial handling of swipe refresh gesture.

This commit is contained in:
Miku AuahDark
2022-05-15 23:59:17 +08:00
parent 1f90ef5646
commit 9e15879b4b
2 changed files with 8 additions and 0 deletions
@@ -2,6 +2,7 @@ package org.love2d.android;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.content.Intent;
import android.os.Build;
@@ -16,6 +17,12 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SwipeRefreshLayout swipeLayout = findViewById(R.id.swipeRefreshLayout);
swipeLayout.setOnRefreshListener(() -> {
// TODO: Actually update list of games
swipeLayout.setRefreshing(false);
});
}
@Override
@@ -7,6 +7,7 @@
tools:context=".MainActivity">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">