deleted old code

This commit is contained in:
JG-Cody 2021-08-14 11:34:17 +02:00
parent 239d568801
commit 5c4c96357d
5 changed files with 1 additions and 127 deletions

View File

@ -1,32 +0,0 @@
package de.jg_cody.Teraplex;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class ActivityCricketers extends AppCompatActivity {
RecyclerView recyclerCricketers;
ArrayList<Cricketer> cricketersList = new ArrayList<>();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cricketers);
recyclerCricketers = findViewById(R.id.recycler_cricketers);
LinearLayoutManager layoutManager = new LinearLayoutManager(this,RecyclerView.VERTICAL,false);
recyclerCricketers.setLayoutManager(layoutManager);
cricketersList = (ArrayList<Cricketer>) getIntent().getExtras().getSerializable("list");
recyclerCricketers.setAdapter(new CricketerAdapter(cricketersList));
}
}

View File

@ -1,26 +0,0 @@
package de.jg_cody.Teraplex;
import java.io.Serializable;
public class Cricketer implements Serializable {
public String cricketerName;
public String teamName;
public Cricketer() {
}
public Cricketer(String cricketerName, String teamName) {
this.cricketerName = cricketerName;
this.teamName = teamName;
}
public String getCricketerName() {
return cricketerName;
}
public String getTeamName() {
return teamName;
}
}

View File

@ -1,57 +0,0 @@
package de.jg_cody.Teraplex;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class CricketerAdapter extends RecyclerView.Adapter<CricketerAdapter.CricketerView> {
ArrayList<Cricketer> cricketersList = new ArrayList<>();
public CricketerAdapter(ArrayList<Cricketer> cricketersList) {
this.cricketersList = cricketersList;
}
@NonNull
@Override
public CricketerView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_cricketer,parent,false);
return new CricketerView(view);
}
@Override
public void onBindViewHolder(@NonNull CricketerView holder, int position) {
Cricketer cricketer = cricketersList.get(position);
holder.textCricketerName.setText(cricketer.getCricketerName());
holder.textTeamName.setText(cricketer.getTeamName());
}
@Override
public int getItemCount() {
return cricketersList.size();
}
public static class CricketerView extends RecyclerView.ViewHolder{
TextView textCricketerName,textTeamName;
public CricketerView(@NonNull View itemView) {
super(itemView);
textCricketerName = (TextView)itemView.findViewById(R.id.text_cricketer_name);
textTeamName = (TextView)itemView.findViewById(R.id.text_team_name);
}
}
}

View File

@ -34,7 +34,6 @@ import java.util.Objects;
import de.jg_cody.Teraplex.AddButtonDialogSingle;
import de.jg_cody.Teraplex.AddButtonsDialogDouble;
import de.jg_cody.Teraplex.AddHeadlineDialog;
import de.jg_cody.Teraplex.Cricketer;
import de.jg_cody.Teraplex.MainActivity;
import de.jg_cody.Teraplex.R;
@ -53,7 +52,7 @@ public class TabsFragment extends Fragment implements AddButtonDialogSingle.AddB
ArrayList<ListItem> items;
ArrayList<Cricketer> cricketersList = new ArrayList<>();
String tabname;

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_cricketers"
android:layout_width="match_parent"
android:layout_height="match_parent"></androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>