spinner is spinning now

This commit is contained in:
Martin Donnelly 2016-11-11 00:08:14 +00:00
parent 70bad7b0cf
commit b731d7fe36
6 changed files with 13 additions and 8 deletions

View File

@ -3,8 +3,9 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

View File

@ -7,7 +7,7 @@ android {
applicationId "com.silvrtree.feedmaster" applicationId "com.silvrtree.feedmaster"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 21 targetSdkVersion 21
versionCode 4 versionCode 5
versionName "1.0" versionName "1.0"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "b3f7f6e472294e8b84ae831357920012"] manifestPlaceholders = [HOCKEYAPP_APP_ID: "b3f7f6e472294e8b84ae831357920012"]
} }

View File

@ -9,4 +9,4 @@
img { img {
max-width: 300px; max-width: 300px;
}</style><link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192"><link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/manifest.json"><meta name="msapplication-TileColor" content="#9f00a7"><meta name="msapplication-TileImage" content="/mstile-144x144.png"><meta name="theme-color" content="#ffffff"></head><body><div class="container"><div class="u-full-width content">Last update: <span id="lastupdate">x</span><div id="list" class="u-full-width content"></div></div></div><div id="feedcontent" class="container"></div><script src="js/vendor.js"></script><script src="js/app.js"></script></body></html> }</style><link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192"><link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/manifest.json"><meta name="msapplication-TileColor" content="#9f00a7"><meta name="msapplication-TileImage" content="/mstile-144x144.png"><meta name="theme-color" content="#ffffff"></head><body><div class="container"><div class="u-full-width content">Last update: <span id="lastupdate">x</span><div id="list" class="u-full-width content"></div></div></div><div id="feedcontent" class="container"></div><script src="js/vendor.js"></script><script src="js/app.prod.js"></script></body></html>

View File

@ -1,4 +0,0 @@
var APP={refreshStep:0,preUrl:'/',_storage:{lastupdated:null,feeds:{}},_list:null,_feed:null,feeds:['paleo','lifestyle','tech','news'],lastUpdated:null,preCache:function(){this._list=new EJS({url:'ejs/list.ejs'});this._feed=new EJS({url:'ejs/test.ejs'});},init:function(){void 0;$.zprogress.start();this.preCache();$.zprogress.inc(0.2);this.doLoad();$.zprogress.inc(0.2);this.getLastUpdateDate();$.zprogress.done(true);void 0;},getLastUpdateDate:function(){var formatted,dt;if(this.lastUpdated==null){$('#lastupdate').empty().append('Never');}else{dt=new Date(this.lastUpdated);formatted=moment(dt).startOf('minute').fromNow();void 0;$('#lastupdate').empty().append(formatted);}},refresh:function(){this.refreshStep=0;void 0;void 0;void 0;$('#lastupdate').empty().append('Refreshing...');this.showAndroidToast('Refreshing...');$.zprogress.start();this.doRefresh();},doRefresh:function(){var self=this;if(this.refreshStep<this.feeds.length){var feedUrl=this.preUrl+this.feeds[this.refreshStep]+'.json';$('#lastupdate').empty().append('Refreshing: '+this.feeds[this.refreshStep]);var jsonData=Android.getJson(feedUrl);if(jsonData!==''){self.doUpdate(JSON.parse(jsonData));}}else{void 0;this.doSave();this.showList();$.zprogress.done(true);}},doUpdate:function(data){this._storage.feeds[this.feeds[this.refreshStep]]=data;void 0;this.refreshStep++;$.zprogress.inc(0.2);this.doRefresh();},doSave:function(){void 0;this.lastUpdated=new Date();this._storage.lastupdated=this.lastUpdated;localStorage.setItem('lastUpdated',this.lastUpdated);localStorage.setItem('_storage',JSON.stringify(this._storage));this.getLastUpdateDate();},doLoad:function(){var _load=localStorage.getItem('_storage');$('#lastupdate').empty().append('Loading...');if(_load!=null){this._storage=JSON.parse(_load);}else{this._storage={lastupdated:null,feeds:{}};}
this.lastUpdated=this._storage.lastupdated||null;this.showList();},clearFeed:function(){$('#feedcontent').empty();},showList:function(){var output,d={},list=[];for(var key in this._storage.feeds){void 0;list.push({name:key});}
d.list=list;output=this._list.render(d);$('#list').empty().append(output);for(var key in this._storage.feeds){$('#'+key).on('click',$.proxy(this.showFeed,this,key));}},showFeed:function(opt){var output,d;void 0;$('#feedcontent').empty();d={d:this._storage.feeds[opt]};output=this._feed.render(d);$('#feedcontent').append(output);$('img').unveil();},showAndroidToast:function(toastmsg){Android.showToast(toastmsg);},showProgress:function(){Android.showProgress();},hideProgress:function(){Android.hideProgress();}};Zepto(function($){void 0;if(typeof(Storage)!=='undefined'){APP.init();}else{void 0;}});

View File

@ -0,0 +1,8 @@
var APP={refreshStep:0,preUrl:'/',_storage:{lastupdated:null,feeds:{}},_list:null,_feed:null,feeds:["paleo","lifestyle","tech","news","fit"],lastUpdated:null,preCache:function(){this._list=new EJS({url:'ejs/list.ejs'});this._feed=new EJS({url:'ejs/test.ejs'});},init:function(){void 0;this.showProgress();this.preCache();this.doLoad();this.getLastUpdateDate();this.hideProgress();void 0;},getLastUpdateDate:function(){var formatted,dt;if(this.lastUpdated==null){$('#lastupdate').empty().append('Never');}
else{dt=new Date(this.lastUpdated);formatted=moment(dt).startOf('minute').fromNow();void 0;$('#lastupdate').empty().append(formatted);}},refresh:function(){this.refreshStep=0;void 0;void 0;void 0;$('#lastupdate').empty().append('Refreshing...');this.showAndroidToast('Refreshing...');this.showProgress();this.doRefresh();},doRefresh:function(){var self=this;if(this.refreshStep<this.feeds.length){var feedUrl=this.preUrl+this.feeds[this.refreshStep]+'.json';$('#lastupdate').empty().append('Refreshing: '+this.feeds[this.refreshStep]);var jsonData=Android.getJson(feedUrl);if(jsonData!==''){self.doUpdate(JSON.parse(jsonData));}}
else{void 0;this.doSave();this.showList();this.hideProgress();}},doUpdate:function(data){this._storage.feeds[this.feeds[this.refreshStep]]=data;void 0;this.refreshStep++;this.showProgress();this.doRefresh();},doSave:function(){void 0;this.lastUpdated=new Date();this._storage.lastupdated=this.lastUpdated;localStorage.setItem('lastUpdated',this.lastUpdated);localStorage.setItem('_storage',JSON.stringify(this._storage));this.getLastUpdateDate();},doLoad:function(){var _load=localStorage.getItem('_storage');$('#lastupdate').empty().append('Loading...');if(_load!=null){this._storage=JSON.parse(_load);}
else{this._storage={lastupdated:null,feeds:{}};}
this.lastUpdated=this._storage.lastupdated||null;this.showList();},clearFeed:function(){$('#feedcontent').empty();},showList:function(){var output,d={},list=[];for(var key in this._storage.feeds){void 0;list.push({name:key});}
d.list=list;output=this._list.render(d);$('#list').empty().append(output);for(var key in this._storage.feeds){$('#'+key).on('click',$.proxy(this.showFeed,this,key));}},showFeed:function(opt){var output,d;void 0;$('#feedcontent').empty();d={d:this._storage.feeds[opt]};output=this._feed.render(d);$('#feedcontent').append(output);$('img').unveil();},showAndroidToast:function(toastmsg){Android.showToast(toastmsg);},showProgress:function(){Android.showProgress();},hideProgress:function(){Android.hideProgress();}};Zepto(function($){void 0;if(typeof(Storage)!=='undefined'){APP.init();}
else{void 0;}});

View File

@ -19,6 +19,6 @@
android:gravity="center" android:gravity="center"
android:layout_gravity="center" android:layout_gravity="center"
android:indeterminate="true" android:indeterminate="true"
style="@android:style/Widget.Material.Light.ProgressBar.Large" /> style="@android:style/Widget.DeviceDefault.Light.ProgressBar" />
</FrameLayout> </FrameLayout>