feat:devkit connect directly
This commit is contained in:
parent
e7ddcd1b67
commit
2f0f0494df
@ -34,7 +34,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import pub.doric.DoricActivity;
|
import pub.doric.DoricActivity;
|
||||||
import pub.doric.devkit.ui.DoricDevActivity;
|
import pub.doric.devkit.DoricDev;
|
||||||
import pub.doric.refresh.DoricSwipeLayout;
|
import pub.doric.refresh.DoricSwipeLayout;
|
||||||
import pub.doric.utils.DoricUtils;
|
import pub.doric.utils.DoricUtils;
|
||||||
|
|
||||||
@ -109,25 +109,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
tv.setOnClickListener(new View.OnClickListener() {
|
tv.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
{
|
DoricDev.getInstance().openDevMode();
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#import <DoricCore/Doric.h>
|
#import <DoricCore/Doric.h>
|
||||||
|
|
||||||
#import <DoricDevkit/DoricDevViewController.h>
|
#import <DoricDevkit/DoricDev.h>
|
||||||
|
|
||||||
#import "ViewController.h"
|
#import "ViewController.h"
|
||||||
|
|
||||||
@ -68,17 +68,7 @@ - (BOOL)isSimulator {
|
|||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
if (indexPath.row == 0) {
|
if (indexPath.row == 0) {
|
||||||
NSString *file = @"Snake.js";
|
[[DoricDev instance] openDevMode];
|
||||||
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];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row];
|
NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row];
|
||||||
|
Reference in New Issue
Block a user