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;
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) {
if (position == 0) {
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
final TextView tv = (TextView) holder.itemView;
if (position == 0) {
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);
}
});

View File

@ -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)];