From fa2171b3ff94c27a731912bf7a14c8bd8203290c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Mon, 24 Feb 2020 17:27:29 +0800 Subject: [PATCH] update main list & add dev kit cell --- .../java/pub/doric/demo/MainActivity.java | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doric-android/app/src/main/java/pub/doric/demo/MainActivity.java b/doric-android/app/src/main/java/pub/doric/demo/MainActivity.java index 21700265..fe7d6e4f 100644 --- a/doric-android/app/src/main/java/pub/doric/demo/MainActivity.java +++ b/doric-android/app/src/main/java/pub/doric/demo/MainActivity.java @@ -100,22 +100,33 @@ public class MainActivity extends AppCompatActivity { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { - final TextView tv = (TextView) holder.itemView; - tv.setText(data[position]); - tv.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(tv.getContext(), DemoDebugActivity.class); - intent.putExtra("source", "assets://src/" + data[position]); - intent.putExtra("alias", data[position]); - tv.getContext().startActivity(intent); - } - }); + if (position == 0) { + final TextView tv = (TextView) holder.itemView; + tv.setText("Dev Kit"); + tv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + + } + }); + } else { + final TextView tv = (TextView) holder.itemView; + tv.setText(data[position - 1]); + tv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(tv.getContext(), DemoDebugActivity.class); + intent.putExtra("source", "assets://src/" + data[position - 1]); + intent.putExtra("alias", data[position - 1]); + tv.getContext().startActivity(intent); + } + }); + } } @Override public int getItemCount() { - return data.length; + return data.length + 1; } } }