mirror of
https://github.com/love2d/love-android.git
synced 2026-08-12 16:41:12 +02:00
Initial handling of swipe refresh gesture.
This commit is contained in:
@@ -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">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user