This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initScriptEnv() { | |
jsContext = org.mozilla.javascript.Context.enter(); | |
jsContext.setOptimizationLevel(-1); | |
jsScope = jsContext.initStandardObjects(); | |
Object RObj = org.mozilla.javascript.Context.javaToJS(new Rwrapper(), jsScope); | |
ScriptableObject.putProperty(jsScope, "R", RObj); | |
ScriptableObject.putProperty(jsScope, "log", new Log()); | |
ScriptableObject.putProperty(jsScope, "findview", new FindViewById(this)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observer = new FileObserver(this.getCacheDir().getAbsolutePath(), FileObserver.ALL_EVENTS) { | |
@Override | |
public void onEvent(int event, String path) { | |
Log.d("Observer","PATH: " + path +" EVENT: " + event); | |
} | |
}; | |
observer.startWatching(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
<title>Tab test</title> | |
<link rel="stylesheet" | |
href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script> | |
<script | |
src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-role="page" id="homepage"> | |
<div id="home" data-title="home" data-role="tab" data-icon="home"> | |
<h1>I'm Tab1</h1> | |
<img src="http://images.apple.com/home/images/hero.jpg" /> | |
</div> | |
<div id="test" data-title="test" data-role="tab" data-icon="info"> | |
<h1>I'm Tab2</h1> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Tabs 2</title> | |
<link rel="stylesheet" href="touch/resources/css/sencha-touch.css" type="text/css"> | |
<script type="text/javascript" src="touch/sencha-touch-all.js"></script> | |
<script type="text/javascript" src="app.js"></script> | |
</head> | |
<body></body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'tabtest1', | |
launch: function() { | |
Ext.create("Ext.TabPanel", { | |
fullscreen: true, | |
tabBar: { | |
docked: 'bottom', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'tabtest1', | |
launch: function() { | |
var tabItems = []; | |
var pages = Ext.query('div[data-role=page]'); | |
var main = pages[0]; //take first page as main page | |
var tabs = Ext.query('div[data-role=tab]', main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public WebResourceResponse shouldInterceptRequest(WebView view, | |
String url) { | |
if(url.startsWith("asset://")) { | |
String fileName = url.substring(8); | |
try { | |
WebResourceResponse resp = new WebResourceResponse("text/javascript", "UTF-8", MyActivity.this.getAssets().open(fileName)); | |
return resp; | |
} catch (IOException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('Ext.data.proxy.Facebook', { | |
extend: 'Ext.data.proxy.Proxy', | |
alias: 'proxy.facebook', | |
constructor: function(config) { | |
this.callParent([config]); | |
this.api = config.api; | |
//ensures that the reader has been instantiated properly | |
this.setReader(this.reader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myStroe = Ext.create('Ext.data.Store', { | |
model: 'Group', | |
proxy: { | |
type: 'facebook', | |
api : '/me/groups' | |
}, | |
autoLoad: false, | |
autoSync: true | |
}); |