Added List button on Home

This commit is contained in:
RemoMeijer
2021-01-04 15:37:09 +01:00
parent e761dd80e5
commit 1b770020ed
10 changed files with 68 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Location;
@@ -25,6 +26,7 @@ public class LocationFragment extends Fragment {
private LocationAdapter locationAdapter;
private RecyclerView.LayoutManager layoutManager;
private List<Location> locationList;
private ImageButton imageButton;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -40,6 +42,12 @@ public class LocationFragment extends Fragment {
this.locationRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext());
// this.imageButton = view.findViewById(R.id.locationBackButton);
// this.imageButton.setOnClickListener(v -> {
// HomeFragment homeFragment = new HomeFragment();
// ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
// });
LocationListManager.INSTANCE.setContext(this.getContext());
LocationListManager.INSTANCE.load();
this.locationList = LocationListManager.INSTANCE.getLocationList();