feat:devkit connect directly

This commit is contained in:
pengfei.zhou 2020-03-28 10:41:13 +08:00 committed by osborn
parent e7ddcd1b67
commit 2f0f0494df
2 changed files with 4 additions and 32 deletions

View File

@ -34,7 +34,7 @@ import java.util.ArrayList;
import java.util.List;
import pub.doric.DoricActivity;
import pub.doric.devkit.ui.DoricDevActivity;
import pub.doric.devkit.DoricDev;
import pub.doric.refresh.DoricSwipeLayout;
import pub.doric.utils.DoricUtils;
@ -109,25 +109,7 @@ public class MainActivity extends AppCompatActivity {
tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
{
for (int i = 0; i != data.length; i++) {
if (data[i].equals("Snake.js")) {
Intent intent = new Intent(tv.getContext(), DoricActivity.class);
intent.putExtra("source", "assets://src/" + data[i]);
intent.putExtra("alias", data[i]);
tv.getContext().startActivity(intent);
}
}
}
{
tv.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(tv.getContext(), DoricDevActivity.class);
tv.getContext().startActivity(intent);
}
}, 4000);
}
DoricDev.getInstance().openDevMode();
}
});
} else {

View File

@ -8,7 +8,7 @@
#import <DoricCore/Doric.h>
#import <DoricDevkit/DoricDevViewController.h>
#import <DoricDevkit/DoricDev.h>
#import "ViewController.h"
@ -68,17 +68,7 @@ - (BOOL)isSimulator {
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {
NSString *file = @"Snake.js";
DoricViewController *doricViewController = [[DoricViewController alloc]
initWithSource:[NSString stringWithFormat:@"assets://src/%@", file]
alias:file
extra:nil
];
[self.navigationController pushViewController:doricViewController animated:NO];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.navigationController pushViewController:[DoricDevViewController new] animated:NO];
}
);
[[DoricDev instance] openDevMode];
return;
}
NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row];