mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Stuff
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
package com.ridgebotics.ridgescout.types;
|
||||||
|
|
||||||
|
public class ColabArray {
|
||||||
|
}
|
||||||
@@ -9,14 +9,13 @@ import com.ridgebotics.ridgescout.utility.ByteBuilder;
|
|||||||
import com.ridgebotics.ridgescout.utility.SettingsManager;
|
import com.ridgebotics.ridgescout.utility.SettingsManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
// Class to contain data for an entire event.
|
// Class to contain data for an entire event.
|
||||||
// Easily encoded and decoded to binary format.
|
// Easily encoded and decoded to binary format.
|
||||||
public class frcEvent {
|
public class frcEvent {
|
||||||
|
|
||||||
public static final int typecode = 254;
|
|
||||||
public String eventCode;
|
public String eventCode;
|
||||||
public String name;
|
public String name;
|
||||||
public ArrayList<frcMatch> matches;
|
public ArrayList<frcMatch> matches;
|
||||||
@@ -134,29 +133,29 @@ public class frcEvent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public
|
|
||||||
|
|
||||||
// Returns the soonest match that there will be all the possible upcoming data on other teams
|
// Returns the soonest match that there will be all the possible upcoming data on other teams
|
||||||
public void getReportMatches(int ourTeamNum){
|
public int getMostInformedBy(int ourTeamNum, int curMatch){
|
||||||
frcMatch[] teamMatches = event.getTeamMatches(ourTeamNum);
|
frcMatch teamMatch = getNextTeamMatch(ourTeamNum, curMatch);
|
||||||
|
|
||||||
for(int i = 0; i < teamMatches.length; i++){
|
int maxMatch = Integer.MIN_VALUE;
|
||||||
int maxMatch = -1;
|
|
||||||
for(int a = 0; a < 6; a++){
|
|
||||||
int teamNum;
|
|
||||||
if(a < 3)
|
|
||||||
teamNum = teamMatches[i].redAlliance[a];
|
|
||||||
else
|
|
||||||
teamNum = teamMatches[i].blueAlliance[a-3];
|
|
||||||
|
|
||||||
if(teamNum == ourTeamNum)
|
for(int a = 0; a < 6; a++){
|
||||||
continue;
|
int teamNum;
|
||||||
|
if(a < 3)
|
||||||
|
teamNum = teamMatch.redAlliance[a];
|
||||||
|
else
|
||||||
|
teamNum = teamMatch.blueAlliance[a-3];
|
||||||
|
|
||||||
int matchNum = event.getMostRecentTeamMatch(teamNum, teamMatches[i].matchIndex);
|
if(teamNum == ourTeamNum)
|
||||||
if(maxMatch < matchNum)
|
continue;
|
||||||
maxMatch = matchNum;
|
|
||||||
}
|
int matchNum = event.getMostRecentTeamMatch(teamNum, teamMatch.matchIndex);
|
||||||
|
if(maxMatch < matchNum)
|
||||||
|
maxMatch = matchNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return maxMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public frcTeam getTeamByNum(int teamNum){
|
public frcTeam getTeamByNum(int teamNum){
|
||||||
@@ -168,6 +167,26 @@ public class frcEvent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<frcTeam> getTeamsSorted() {
|
||||||
|
int[] teamNums = new int[teams.size()];
|
||||||
|
|
||||||
|
for(int i = 0 ; i < teams.size(); i++){
|
||||||
|
teamNums[i] = teams.get(i).teamNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
Arrays.sort(teamNums);
|
||||||
|
|
||||||
|
List<frcTeam> list = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < teams.size(); i++){
|
||||||
|
frcTeam team = getTeamByNum(teamNums[i]);
|
||||||
|
assert team != null;
|
||||||
|
list.add(team);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean getIsBlueAlliance(int teamNum, int matchNum){
|
public boolean getIsBlueAlliance(int teamNum, int matchNum){
|
||||||
return getIsBlueAlliance(teamNum, matches.get(matchNum));
|
return getIsBlueAlliance(teamNum, matches.get(matchNum));
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -89,7 +90,7 @@ public class ScoutingFragment extends Fragment {
|
|||||||
|
|
||||||
binding.textMatchAlliance.setVisibility(View.GONE);
|
binding.textMatchAlliance.setVisibility(View.GONE);
|
||||||
binding.textName.setVisibility(View.GONE);
|
binding.textName.setVisibility(View.GONE);
|
||||||
binding.textNextMatch.setVisibility(View.GONE);
|
binding.infoBox.setVisibility(View.GONE);
|
||||||
binding.textRescoutIndicator.setVisibility(View.GONE);
|
binding.textRescoutIndicator.setVisibility(View.GONE);
|
||||||
|
|
||||||
binding.matchScoutingButton.setEnabled(false);
|
binding.matchScoutingButton.setEnabled(false);
|
||||||
@@ -123,21 +124,7 @@ public class ScoutingFragment extends Fragment {
|
|||||||
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_scouting_event);
|
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_scouting_event);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateDashboard();
|
||||||
binding.textName.setText("Welcome, " + SettingsManager.getUsername() + "!");
|
|
||||||
|
|
||||||
int matchNum = SettingsManager.getMatchNum();
|
|
||||||
int nextMatch = -1;
|
|
||||||
int teamNum = SettingsManager.getTeamNum();
|
|
||||||
try {
|
|
||||||
nextMatch = event.getNextTeamMatch(teamNum, matchNum).matchIndex;
|
|
||||||
} catch (Exception e){
|
|
||||||
AlertManager.error("Sorry, in event ("+evcode+"), your team number ("+teamNum+") wasn't found!", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.textNextMatch.setText("Our next match: Match " + nextMatch);
|
|
||||||
binding.textMatchAlliance.setText("Match: " + (matchNum+1) + ", " + SettingsManager.getAllyPos());
|
|
||||||
binding.textRescoutIndicator.setText("Things to rescout: " + DataManager.rescout_list.size());
|
|
||||||
|
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
@@ -166,4 +153,32 @@ public class ScoutingFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateDashboard() {
|
||||||
|
binding.textName.setText("Welcome, " + SettingsManager.getUsername() + "!");
|
||||||
|
|
||||||
|
int curMatchNum = SettingsManager.getMatchNum();
|
||||||
|
int nextMatch;
|
||||||
|
int teamNum = SettingsManager.getTeamNum();
|
||||||
|
try {
|
||||||
|
nextMatch = event.getNextTeamMatch(teamNum, curMatchNum).matchIndex;
|
||||||
|
} catch (Exception e){
|
||||||
|
AlertManager.error("Sorry, in event ("+evcode+"), your team number ("+teamNum+") wasn't found!", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.textMatchAlliance.setText("Match: " + (curMatchNum+1) + ", " + SettingsManager.getAllyPos());
|
||||||
|
binding.textRescoutIndicator.setText("Things to rescout: " + DataManager.rescout_list.size());
|
||||||
|
|
||||||
|
TextView nextMatchText = new TextView(getContext());
|
||||||
|
nextMatchText.setText("Our next match: Match " + nextMatch);
|
||||||
|
nextMatchText.setTextAppearance(com.google.android.material.R.style.TextAppearance_MaterialComponents_Body1);
|
||||||
|
binding.infoBox.addView(nextMatchText);
|
||||||
|
|
||||||
|
int informedBy = event.getMostInformedBy(teamNum, curMatchNum);
|
||||||
|
|
||||||
|
TextView mostInformedText = new TextView(getContext());
|
||||||
|
mostInformedText.setText("Most informed by: Match " + informedBy);
|
||||||
|
mostInformedText.setTextAppearance(com.google.android.material.R.style.TextAppearance_MaterialComponents_Body1);
|
||||||
|
binding.infoBox.addView(mostInformedText);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.ridgebotics.ridgescout.ui.transfer.codes;
|
package com.ridgebotics.ridgescout.ui.transfer.codes;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -21,25 +19,12 @@ import androidx.fragment.app.Fragment;
|
|||||||
import com.ridgebotics.ridgescout.databinding.FragmentTransferCodeSenderBinding;
|
import com.ridgebotics.ridgescout.databinding.FragmentTransferCodeSenderBinding;
|
||||||
import com.ridgebotics.ridgescout.utility.AlertManager;
|
import com.ridgebotics.ridgescout.utility.AlertManager;
|
||||||
import com.ridgebotics.ridgescout.utility.FileEditor;
|
import com.ridgebotics.ridgescout.utility.FileEditor;
|
||||||
import com.google.zxing.BarcodeFormat;
|
|
||||||
import com.google.zxing.EncodeHintType;
|
|
||||||
import com.google.zxing.MultiFormatWriter;
|
|
||||||
import com.google.zxing.WriterException;
|
|
||||||
import com.google.zxing.common.BitMatrix;
|
|
||||||
import com.ridgebotics.ridgescout.utility.TaskRunner;
|
import com.ridgebotics.ridgescout.utility.TaskRunner;
|
||||||
|
|
||||||
import java.lang.reflect.Executable;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
// Class to show the code transfer thing.
|
// Class to show the code transfer thing.
|
||||||
public class CodeGeneratorView extends Fragment {
|
public class CodeGeneratorView extends Fragment {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class CustomSpinnerView extends LinearLayout {
|
|||||||
this.index = defaultOption;
|
this.index = defaultOption;
|
||||||
|
|
||||||
if(defaultOption != -1)
|
if(defaultOption != -1)
|
||||||
this.item.setText(options.get(defaultOption));
|
this.item.setText("▼ " + options.get(defaultOption));
|
||||||
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||||
@@ -110,7 +110,7 @@ public class CustomSpinnerView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOption(int index) {
|
public void setOption(int index) {
|
||||||
item.setText(options.get(index));
|
item.setText("▼ " + options.get(index));
|
||||||
this.index = index;
|
this.index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.ridgebotics.ridgescout.ui.views;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecyclerAdapter<T> extends RecyclerView.Adapter<RecyclerHolder<T>> {
|
||||||
|
private List<T> items;
|
||||||
|
private final int layoutResId;
|
||||||
|
private final RecyclerHolderFactory<T> viewHolderFactory;
|
||||||
|
private RecyclerClickListener<T> onItemClickListener;
|
||||||
|
|
||||||
|
public RecyclerAdapter(int layoutResId, RecyclerHolderFactory<T> viewHolderFactory) {
|
||||||
|
this.items = new ArrayList<>();
|
||||||
|
this.layoutResId = layoutResId;
|
||||||
|
this.viewHolderFactory = viewHolderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RecyclerHolder<T> onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(layoutResId, parent, false);
|
||||||
|
return viewHolderFactory.createViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(RecyclerHolder<T> holder, int position) {
|
||||||
|
T item = items.get(position);
|
||||||
|
holder.bind(item, position);
|
||||||
|
holder.setOnItemClickListener(item, onItemClickListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
// List management methods
|
||||||
|
public void setItems(List<T> newItems) {
|
||||||
|
this.items.clear();
|
||||||
|
if (newItems != null) {
|
||||||
|
this.items.addAll(newItems);
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(T item) {
|
||||||
|
items.add(item);
|
||||||
|
notifyItemInserted(items.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(int position, T item) {
|
||||||
|
items.add(position, item);
|
||||||
|
notifyItemInserted(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItem(int position) {
|
||||||
|
if (position >= 0 && position < items.size()) {
|
||||||
|
items.remove(position);
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItem(T item) {
|
||||||
|
int position = items.indexOf(item);
|
||||||
|
if (position != -1) {
|
||||||
|
removeItem(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateItem(int position, T item) {
|
||||||
|
if (position >= 0 && position < items.size()) {
|
||||||
|
items.set(position, item);
|
||||||
|
notifyItemChanged(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
int size = items.size();
|
||||||
|
items.clear();
|
||||||
|
notifyItemRangeRemoved(0, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getItem(int position) {
|
||||||
|
return items.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> getItems() {
|
||||||
|
return new ArrayList<>(items);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnItemClickListener(RecyclerClickListener<T> listener) {
|
||||||
|
this.onItemClickListener = listener;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.ridgebotics.ridgescout.ui.views;
|
||||||
|
|
||||||
|
public interface RecyclerClickListener<T> {
|
||||||
|
void onItemClick(T item, int position);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ridgebotics.ridgescout.ui.views;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public abstract class RecyclerHolder<T> extends RecyclerView.ViewHolder {
|
||||||
|
public RecyclerHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void bind(T item, int position);
|
||||||
|
|
||||||
|
// Optional method for handling item clicks
|
||||||
|
public void setOnItemClickListener(T item, RecyclerClickListener<T> listener) {
|
||||||
|
if (listener != null) {
|
||||||
|
itemView.setOnClickListener(v -> listener.onItemClick(item, getAdapterPosition()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.ridgebotics.ridgescout.ui.views;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
public interface RecyclerHolderFactory<T> {
|
||||||
|
RecyclerHolder<T> createViewHolder(View itemView);
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package com.ridgebotics.ridgescout.ui.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecyclerList<T> extends RecyclerView {
|
||||||
|
private RecyclerAdapter<T> adapter;
|
||||||
|
|
||||||
|
public RecyclerList(Context context) {
|
||||||
|
super(context);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
// Set default layout manager
|
||||||
|
setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
|
// Enable optimizations
|
||||||
|
setHasFixedSize(true);
|
||||||
|
setItemViewCacheSize(20);
|
||||||
|
setDrawingCacheEnabled(true);
|
||||||
|
setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup method to configure the RecyclerView
|
||||||
|
public RecyclerList<T> setup(int layoutResId, RecyclerHolderFactory<T> RecyclerHolderFactory) {
|
||||||
|
adapter = new RecyclerAdapter<>(layoutResId, RecyclerHolderFactory);
|
||||||
|
setAdapter(adapter);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Layout manager convenience methods
|
||||||
|
public RecyclerList<T> withLinearLayout() {
|
||||||
|
setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList<T> withLinearLayout(int orientation) {
|
||||||
|
setLayoutManager(new LinearLayoutManager(getContext(), orientation, false));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList<T> withGridLayout(int spanCount) {
|
||||||
|
setLayoutManager(new GridLayoutManager(getContext(), spanCount));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList<T> withDivider() {
|
||||||
|
DividerItemDecoration divider = new DividerItemDecoration(getContext(),
|
||||||
|
DividerItemDecoration.VERTICAL);
|
||||||
|
addItemDecoration(divider);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerList<T> withItemClickListener(RecyclerClickListener<T> listener) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.setOnItemClickListener(listener);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Data management methods
|
||||||
|
public void setItems(List<T> items) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.setItems(items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(T item) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.addItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(int position, T item) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.addItem(position, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItem(int position) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.removeItem(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItem(T item) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.removeItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateItem(int position, T item) {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.updateItem(position, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
if (adapter != null) {
|
||||||
|
adapter.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getItem(int position) {
|
||||||
|
return adapter != null ? adapter.getItem(position) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> getItems() {
|
||||||
|
return adapter != null ? adapter.getItems() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerAdapter<T> getGenericAdapter() {
|
||||||
|
return adapter;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -92,17 +92,6 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/text_next_match"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="TextView"
|
|
||||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/text_name" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_match_alliance"
|
android:id="@+id/text_match_alliance"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -122,6 +111,15 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/event_button" />
|
app:layout_constraintTop_toBottomOf="@+id/event_button" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/info_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/text_name" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user