feat: change alias to dev in demo app

This commit is contained in:
pengfei.zhou 2021-12-08 11:45:26 +08:00 committed by osborn
parent 68ba8875a5
commit 4fb5848ca9
2 changed files with 6 additions and 5 deletions

View File

@ -15,6 +15,7 @@
*/ */
package pub.doric.demo; package pub.doric.demo;
import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
@ -102,9 +103,9 @@ public class MainActivity extends AppCompatActivity {
} }
@Override @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) { if (position == 0) {
final TextView tv = (TextView) holder.itemView;
tv.setText("Dev Kit"); tv.setText("Dev Kit");
tv.setOnClickListener(new View.OnClickListener() { tv.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -113,14 +114,14 @@ public class MainActivity extends AppCompatActivity {
} }
}); });
} else { } else {
final TextView tv = (TextView) holder.itemView;
tv.setText(data[position - 1]); tv.setText(data[position - 1]);
tv.setOnClickListener(new View.OnClickListener() { tv.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(tv.getContext(), DoricDebugTimingActivity.class); Intent intent = new Intent(tv.getContext(), DoricDebugTimingActivity.class);
intent.putExtra("source", "assets://src/" + data[position - 1]); 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); tv.getContext().startActivity(intent);
} }
}); });

View File

@ -87,7 +87,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row]; NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row];
DoricViewController *doricViewController = [[DoricViewController alloc] DoricViewController *doricViewController = [[DoricViewController alloc]
initWithSource:[NSString stringWithFormat:@"assets://src/%@", file] initWithSource:[NSString stringWithFormat:@"assets://src/%@", file]
alias:self.demoFilePaths[(NSUInteger) indexPath.row] alias:@"__dev__"//self.demoFilePaths[(NSUInteger) indexPath.row]
extra:nil extra:nil
]; ];
UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"Devkit" style:UIBarButtonItemStylePlain target:self action:@selector(onOpenDevkit)]; UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"Devkit" style:UIBarButtonItemStylePlain target:self action:@selector(onOpenDevkit)];