murakumo_修正パッチその2 #18
|
@ -1,58 +1,58 @@
|
||||||
//package com.example.oplogy;
|
package com.example.oplogy;
|
||||||
//
|
|
||||||
//import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
//import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
//import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
//
|
|
||||||
//import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
//import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
//
|
|
||||||
//import com.example.oplogy.databinding.SubmissionBinding;
|
import com.example.oplogy.databinding.SubmissionBinding;
|
||||||
//
|
|
||||||
//import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
//import java.util.List;
|
import java.util.List;
|
||||||
//
|
|
||||||
//public class SubmissionActivity extends AppCompatActivity {
|
public class SubmissionActivity extends AppCompatActivity {
|
||||||
// private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
// private SubmissionAdapter submissionAdapter;
|
private SubmissionAdapter submissionAdapter;
|
||||||
// private List<SubmissionStudent> students = new ArrayList<>();
|
private List<SubmissionStudent> students = new ArrayList<>();
|
||||||
// ArrayList<Integer> studentNumbers = new ArrayList<>();
|
ArrayList<Integer> studentNumbers = new ArrayList<>();
|
||||||
// private int totalStudent = 10;
|
private int totalStudent = 10;
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
// setContentView(R.layout.submission);
|
setContentView(R.layout.submission);
|
||||||
//
|
|
||||||
// // 戻るボタンの処理
|
// 戻るボタンの処理
|
||||||
// ImageView backButton = findViewById(R.id.BackMain_fromSubmission);
|
ImageView backButton = findViewById(R.id.BackMain_fromSubmission);
|
||||||
// backButton.setOnClickListener(v -> {
|
backButton.setOnClickListener(v -> {
|
||||||
// finish();
|
finish();
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
//
|
|
||||||
// // インテントから提出状況の生徒の数を取得
|
// インテントから提出状況の生徒の数を取得
|
||||||
// studentNumbers=getIntent().getIntegerArrayListExtra("submissionStudents");
|
studentNumbers=getIntent().getIntegerArrayListExtra("submissionStudents");
|
||||||
//
|
|
||||||
// recyclerView = findViewById(R.id.recyclerView);
|
recyclerView = findViewById(R.id.recyclerView);
|
||||||
// recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
// submissionAdapter = new SubmissionAdapter(students);
|
submissionAdapter = new SubmissionAdapter(students);
|
||||||
// recyclerView.setAdapter(submissionAdapter);
|
recyclerView.setAdapter(submissionAdapter);
|
||||||
//
|
|
||||||
// // 生徒のリストを取得
|
// 生徒のリストを取得
|
||||||
// fetchStudents();
|
fetchStudents();
|
||||||
// }
|
}
|
||||||
// private void fetchStudents() {
|
private void fetchStudents() {
|
||||||
// // インテントから生徒のリストを取得
|
// インテントから生徒のリストを取得
|
||||||
// ArrayList<SubmissionStudent> submissionStudents = getIntent().getParcelableArrayListExtra("submissionStudents");
|
ArrayList<SubmissionStudent> submissionStudents = getIntent().getParcelableArrayListExtra("submissionStudents");
|
||||||
//
|
|
||||||
// // 生徒のリストを反復処理し、それをRecyclerViewに表示
|
// 生徒のリストを反復処理し、それをRecyclerViewに表示
|
||||||
// for (SubmissionStudent student : submissionStudents) {
|
for (SubmissionStudent student : submissionStudents) {
|
||||||
// students.add(student);
|
students.add(student);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // データが変更されたことをアダプターに通知
|
// データが変更されたことをアダプターに通知
|
||||||
// submissionAdapter.notifyDataSetChanged();
|
submissionAdapter.notifyDataSetChanged();
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
|
|
|
@ -1,62 +1,62 @@
|
||||||
//package com.example.oplogy;
|
package com.example.oplogy;
|
||||||
//
|
|
||||||
//import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
//import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
//import android.view.View;
|
import android.view.View;
|
||||||
//import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
//import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
//import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
//import java.util.List;
|
import java.util.List;
|
||||||
//
|
|
||||||
//public class SubmissionAdapter extends RecyclerView.Adapter<SubmissionAdapter.StudentViewHolder> {
|
public class SubmissionAdapter extends RecyclerView.Adapter<SubmissionAdapter.StudentViewHolder> {
|
||||||
//
|
|
||||||
// private List<SubmissionStudent> students;
|
private List<SubmissionStudent> students;
|
||||||
//
|
|
||||||
// public static class StudentViewHolder extends RecyclerView.ViewHolder {
|
public static class StudentViewHolder extends RecyclerView.ViewHolder {
|
||||||
// public TextView studentNumberTextView;
|
public TextView studentNumberTextView;
|
||||||
// public TextView statusTextView;
|
public TextView statusTextView;
|
||||||
//
|
|
||||||
// public StudentViewHolder(View view) {
|
public StudentViewHolder(View view) {
|
||||||
// super(view);
|
super(view);
|
||||||
// // レイアウトファイルのTextViewを取得
|
// レイアウトファイルのTextViewを取得
|
||||||
// studentNumberTextView = view.findViewById(R.id.studentNumberTextView);
|
studentNumberTextView = view.findViewById(R.id.studentNumberTextView);
|
||||||
// statusTextView = view.findViewById(R.id.statusTextView);
|
statusTextView = view.findViewById(R.id.statusTextView);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public SubmissionAdapter(List<SubmissionStudent> students) {
|
public SubmissionAdapter(List<SubmissionStudent> students) {
|
||||||
// this.students = students;
|
this.students = students;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public StudentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
public StudentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
// View view = LayoutInflater.from(parent.getContext())
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
// .inflate(R.layout.row_submission, parent, false);
|
.inflate(R.layout.row_submission, parent, false);
|
||||||
// return new StudentViewHolder(view);
|
return new StudentViewHolder(view);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onBindViewHolder(StudentViewHolder holder, int position) {
|
public void onBindViewHolder(StudentViewHolder holder, int position) {
|
||||||
// SubmissionStudent student = students.get(position);
|
SubmissionStudent student = students.get(position);
|
||||||
// holder.studentNumberTextView.setText(String.valueOf(student.getStudentNumber()));
|
holder.studentNumberTextView.setText(String.valueOf(student.getStudentNumber()));
|
||||||
// // 提出済みかどうかで表示を変える
|
// 提出済みかどうかで表示を変える
|
||||||
// if (student.isSubmitted()) {
|
if (student.isSubmitted()) {
|
||||||
// holder.statusTextView.setText("提出済み");
|
holder.statusTextView.setText("提出済み");
|
||||||
// holder.statusTextView.setBackgroundColor(Color.BLACK);
|
holder.statusTextView.setBackgroundColor(Color.BLACK);
|
||||||
// holder.statusTextView.setTextColor(Color.WHITE);
|
holder.statusTextView.setTextColor(Color.WHITE);
|
||||||
// holder.studentNumberTextView.setBackgroundColor(Color.BLACK);
|
holder.studentNumberTextView.setBackgroundColor(Color.BLACK);
|
||||||
// holder.studentNumberTextView.setTextColor(Color.WHITE);
|
holder.studentNumberTextView.setTextColor(Color.WHITE);
|
||||||
// } else {
|
} else {
|
||||||
// holder.statusTextView.setText("未提出");
|
holder.statusTextView.setText("未提出");
|
||||||
// holder.statusTextView.setBackgroundColor(Color.RED);
|
holder.statusTextView.setBackgroundColor(Color.RED);
|
||||||
// holder.statusTextView.setTextColor(Color.WHITE);
|
holder.statusTextView.setTextColor(Color.WHITE);
|
||||||
// holder.studentNumberTextView.setBackgroundColor(Color.RED);
|
holder.studentNumberTextView.setBackgroundColor(Color.RED);
|
||||||
// holder.studentNumberTextView.setTextColor(Color.WHITE);
|
holder.studentNumberTextView.setTextColor(Color.WHITE);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int getItemCount() {
|
public int getItemCount() {
|
||||||
// return students.size();
|
return students.size();
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
|
@ -1,49 +1,49 @@
|
||||||
//package com.example.oplogy;
|
package com.example.oplogy;
|
||||||
//import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
//import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
//
|
|
||||||
//public class SubmissionStudent implements Parcelable {
|
public class SubmissionStudent implements Parcelable {
|
||||||
// private int studentNumber;
|
private int studentNumber;
|
||||||
// private boolean submitted;
|
private boolean submitted;
|
||||||
//
|
|
||||||
// public SubmissionStudent(int studentNumber, boolean submitted) {
|
public SubmissionStudent(int studentNumber, boolean submitted) {
|
||||||
// this.studentNumber = studentNumber;
|
this.studentNumber = studentNumber;
|
||||||
// this.submitted = submitted;
|
this.submitted = submitted;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// protected SubmissionStudent(Parcel in) {
|
protected SubmissionStudent(Parcel in) {
|
||||||
// studentNumber = in.readInt();
|
studentNumber = in.readInt();
|
||||||
// submitted = in.readByte() != 0;
|
submitted = in.readByte() != 0;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public static final Creator<SubmissionStudent> CREATOR = new Creator<SubmissionStudent>() {
|
public static final Creator<SubmissionStudent> CREATOR = new Creator<SubmissionStudent>() {
|
||||||
// @Override
|
@Override
|
||||||
// public SubmissionStudent createFromParcel(Parcel in) {
|
public SubmissionStudent createFromParcel(Parcel in) {
|
||||||
// return new SubmissionStudent(in);
|
return new SubmissionStudent(in);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public SubmissionStudent[] newArray(int size) {
|
public SubmissionStudent[] newArray(int size) {
|
||||||
// return new SubmissionStudent[size];
|
return new SubmissionStudent[size];
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
//
|
|
||||||
// public int getStudentNumber() {
|
public int getStudentNumber() {
|
||||||
// return studentNumber;
|
return studentNumber;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public boolean isSubmitted() {
|
public boolean isSubmitted() {
|
||||||
// return submitted;
|
return submitted;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public int describeContents() {
|
public int describeContents() {
|
||||||
// return 0;
|
return 0;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void writeToParcel(Parcel parcel, int i) {
|
public void writeToParcel(Parcel parcel, int i) {
|
||||||
// parcel.writeInt(studentNumber);
|
parcel.writeInt(studentNumber);
|
||||||
// parcel.writeByte((byte) (submitted ? 1 : 0));
|
parcel.writeByte((byte) (submitted ? 1 : 0));
|
||||||
// }
|
}
|
||||||
//}
|
}
|
31
app/src/main/res/layout/row_submission.xml
Normal file
31
app/src/main/res/layout/row_submission.xml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/studentNumberTextView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="番号"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="36sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/statusTextView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:text="提出状況"
|
||||||
|
android:textSize="36sp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
</LinearLayout>
|
|
@ -1,9 +1,43 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="10"
|
||||||
tools:context=".SubmissionActivity">
|
tools:context=".SubmissionActivity">
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="10">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/BackMain_fromSubmission"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:src="@drawable/back_button" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/imageSubmission"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="4"
|
||||||
|
android:hint="提出状況"
|
||||||
|
android:textSize="40dp"
|
||||||
|
android:padding="8dp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user