Revの作成日時を表示できるように

This commit is contained in:
r-ca 2024-01-23 05:17:53 +09:00
parent e69d489a96
commit 56a49d4c7e
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -8,6 +8,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
@ -40,13 +41,14 @@ public class RevAdapter extends RecyclerView.Adapter<RevAdapter.RevViewHolder>{
@Override
public void onBindViewHolder(@NonNull RevAdapter.RevViewHolder holder, int position) {
VcsRevModel revModel = revModels.get(position);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
holder.title.setText(revModel.getCommitMessage());
if (FeatureSwitch.Vcs.disableBranchDisplay) {
// holder.detail.setText(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(revModel.getCreatedAt().toInstant()));
holder.detail.setText("DateTimePlaceholder");
holder.detail.setText(simpleDateFormat.format(revModel.getCreatedAt()));
} else {
// holder.detail.setText(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(revModel.getCreatedAt().toInstant()) + " " + revModel.getBranchName());
holder.detail.setText("DateTimePlaceholder" + " " + revModel.getBranchName());
holder.detail.setText(simpleDateFormat.format(revModel.getCreatedAt())+ " " + revModel.getBranchName());
}
holder.revId.setText("RevID: " + revModel.getId());