bruh moment
This commit is contained in:
parent
b9763a5277
commit
8c8d7f21a7
@ -27,6 +27,9 @@ public class CrimeListActivity extends SingleFragmentActivity {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("CrimeArrayList", (Serializable) crimes);
|
||||
crimeList.setArguments(bundle);
|
||||
|
||||
|
||||
|
||||
return crimeList;
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,13 @@ package asdv.lisset.criminalintent;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Layout;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -17,7 +17,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CrimeListFragment extends Fragment {
|
||||
@ -41,6 +40,8 @@ public class CrimeListFragment extends Fragment {
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
Bundle b = getArguments();
|
||||
this.crimeList = (List<Crime>) b.getSerializable("CrimeArrayList");
|
||||
}
|
||||
@ -49,9 +50,12 @@ public class CrimeListFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater,
|
||||
ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
|
||||
View view =
|
||||
inflater.inflate(R.layout.fragment_crime_list,
|
||||
container, false);
|
||||
|
||||
crimeRecyclerView = (RecyclerView) view
|
||||
.findViewById(R.id.crime_recycler_view);
|
||||
crimeRecyclerView.setLayoutManager(
|
||||
@ -66,6 +70,12 @@ public class CrimeListFragment extends Fragment {
|
||||
updateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
inflater.inflate(R.id.crime_menu, menu);
|
||||
}
|
||||
|
||||
//CRIME HOLDER
|
||||
// ... it holds crimes
|
||||
// CRIMES AGAINST PROGRAMMING
|
||||
|
@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
@ -20,6 +21,9 @@ public abstract class SingleFragmentActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_fragment);
|
||||
//init toolbar
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.crime_toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
FragmentManager fm =
|
||||
getSupportFragmentManager();
|
||||
fragment =
|
||||
|
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.6">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
</vector>
|
Binary file not shown.
After Width: | Height: | Size: 226 B |
Binary file not shown.
After Width: | Height: | Size: 141 B |
Binary file not shown.
After Width: | Height: | Size: 159 B |
Binary file not shown.
After Width: | Height: | Size: 260 B |
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/crime_menu">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/crime_toolbar"
|
||||
android:icon="@drawable/ic_menu_add"
|
||||
android:title="@string/new_crime"
|
||||
app:showAsAction="ifRoom|withText"/>
|
||||
</menu>
|
@ -6,4 +6,8 @@
|
||||
<string name="crime_details_label">DETAILS</string>
|
||||
<string name="crime_solved_label">Solved</string>
|
||||
<string name="date_picker_title">Date of crime: </string>
|
||||
<string name="new_crime">New Crime</string>
|
||||
<string name="show_subtitle">Show Subtitle</string>
|
||||
<string name="hide_subtitle">Hide Subtitle</string>
|
||||
<string name="subtitle_format">%1$d crimes</string>
|
||||
</resources>
|
BIN
Assignments/MP1_Ajax.zip
Normal file
BIN
Assignments/MP1_Ajax.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user