From 4fb5848ca997e31cd89fb8df8e595e7ffda7391e Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 8 Dec 2021 11:45:26 +0800 Subject: [PATCH] feat: change alias to dev in demo app --- .../app/src/main/java/pub/doric/demo/MainActivity.java | 9 +++++---- doric-iOS/Example/Example/ViewController.m | 2 +- 2 files changed, 6 insertions(+), 5 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 b7e85307..7c4b1133 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 @@ -15,6 +15,7 @@ */ package pub.doric.demo; +import android.annotation.SuppressLint; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; @@ -102,9 +103,9 @@ public class MainActivity extends AppCompatActivity { } @Override - public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") final int position) { + final TextView tv = (TextView) holder.itemView; if (position == 0) { - final TextView tv = (TextView) holder.itemView; tv.setText("Dev Kit"); tv.setOnClickListener(new View.OnClickListener() { @Override @@ -113,14 +114,14 @@ public class MainActivity extends AppCompatActivity { } }); } 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(), DoricDebugTimingActivity.class); intent.putExtra("source", "assets://src/" + data[position - 1]); - intent.putExtra("alias", data[position - 1].replace(".js", "")); + //intent.putExtra("alias", data[position - 1].replace(".js", "")); + intent.putExtra("alias", "__dev__"); tv.getContext().startActivity(intent); } }); diff --git a/doric-iOS/Example/Example/ViewController.m b/doric-iOS/Example/Example/ViewController.m index 46432875..16c61c4a 100644 --- a/doric-iOS/Example/Example/ViewController.m +++ b/doric-iOS/Example/Example/ViewController.m @@ -87,7 +87,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row]; DoricViewController *doricViewController = [[DoricViewController alloc] initWithSource:[NSString stringWithFormat:@"assets://src/%@", file] - alias:self.demoFilePaths[(NSUInteger) indexPath.row] + alias:@"__dev__"//self.demoFilePaths[(NSUInteger) indexPath.row] extra:nil ]; UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"Devkit" style:UIBarButtonItemStylePlain target:self action:@selector(onOpenDevkit)];