Pictogram 1.6, Beta 1

parent d5c40671
...@@ -142,6 +142,7 @@ public class RestapiWrapper { ...@@ -142,6 +142,7 @@ public class RestapiWrapper {
StringBuilder response=new StringBuilder(""); StringBuilder response=new StringBuilder("");
String line; String line;
JSONObject JSONresponse; JSONObject JSONresponse;
BufferedReader br = new BufferedReader(new InputStreamReader(responseCode == HttpURLConnection.HTTP_OK BufferedReader br = new BufferedReader(new InputStreamReader(responseCode == HttpURLConnection.HTTP_OK
? urlConnection.getInputStream() ? urlConnection.getInputStream()
: urlConnection.getErrorStream())); : urlConnection.getErrorStream()));
...@@ -194,7 +195,6 @@ public class RestapiWrapper { ...@@ -194,7 +195,6 @@ public class RestapiWrapper {
urlConnection.setRequestMethod("GET"); urlConnection.setRequestMethod("GET");
urlConnection.setDoInput(true); urlConnection.setDoInput(true);
urlConnection.connect(); urlConnection.connect();
return RestapiWrapper.resultToJSON(urlConnection); return RestapiWrapper.resultToJSON(urlConnection);
} }
...@@ -289,7 +289,6 @@ public class RestapiWrapper { ...@@ -289,7 +289,6 @@ public class RestapiWrapper {
// onPostExecute displays the results of the AsyncTask. // onPostExecute displays the results of the AsyncTask.
@Override @Override
protected void onPostExecute(HttpAsyncTaskParams params) { protected void onPostExecute(HttpAsyncTaskParams params) {
if (params.error!=null) { if (params.error!=null) {
if (silentLogin!=null && !silentLogin.isValidToken(params.error, params.result)) { if (silentLogin!=null && !silentLogin.isValidToken(params.error, params.result)) {
silentLogin.login(); silentLogin.login();
......
...@@ -243,7 +243,8 @@ public class UserLogin { ...@@ -243,7 +243,8 @@ public class UserLogin {
public void loadComplete() { public void loadComplete() {
PCBcontext.getDevice().insertUser(student); PCBcontext.getDevice().insertUser(student);
if(progressDialog.isShowing()) progressDialog.dismiss(); if(progressDialog.isShowing()) progressDialog.dismiss();
activity.startActivity(pictogramActivity);
activity.startActivity(pictogramActivity);
} }
......
...@@ -52,8 +52,10 @@ public class VocabularyDownloader { ...@@ -52,8 +52,10 @@ public class VocabularyDownloader {
grids_reamining.remove(0); grids_reamining.remove(0);
downloaded_scenes.add(id_grid); downloaded_scenes.add(id_grid);
synchronize(next_grid, grids_reamining, downloaded_scenes); synchronize(next_grid, grids_reamining, downloaded_scenes);
} else } else {
this.imgListener.loadComplete();
TransactionMonitor.endTransaction(true); TransactionMonitor.endTransaction(true);
}
} }
private void synchronize(final int id_grid, final Vector<Integer> grids_reamining, final Vector<Integer> downloaded_scenes) { private void synchronize(final int id_grid, final Vector<Integer> grids_reamining, final Vector<Integer> downloaded_scenes) {
if (downloaded_scenes.contains(id_grid)) if (downloaded_scenes.contains(id_grid))
...@@ -159,8 +161,8 @@ public class VocabularyDownloader { ...@@ -159,8 +161,8 @@ public class VocabularyDownloader {
} }
Log.d(this.getClass().getName(), "Vocabulary size: " + updated_collection.length); Log.d(this.getClass().getName(), "Vocabulary size: " + updated_collection.length);
ImgDownloader downloader = new ImgDownloader(PCBcontext.getContext(), imgListener,ImgDownloader.tsource.remote); ImgDownloader downloader = new ImgDownloader(PCBcontext.getContext(), null,ImgDownloader.tsource.remote);
downloader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, imgs); downloader.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, imgs);
} }
/** /**
......
...@@ -174,6 +174,5 @@ ...@@ -174,6 +174,5 @@
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
<orderEntry type="library" exported="" name="tabletlibrary-unspecified" level="project" />
</component> </component>
</module> </module>
\ No newline at end of file
...@@ -295,11 +295,11 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular ...@@ -295,11 +295,11 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular
} }
@Override @Override
protected void onStart() { protected void onResume() {
super.onStart(); super.onResume();
onWindowFocusChanged(true); Log.e(LOG_TAG,"onResume**************");
//onWindowFocusChanged(true);
if (!PCBcontext.getVocabulary().isVisibleAnyPicto()) { if (!PCBcontext.getVocabulary().isVisibleAnyPicto()) {
onResumeWhenEmptyScene(); onResumeWhenEmptyScene();
...@@ -420,6 +420,7 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular ...@@ -420,6 +420,7 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular
super.onPause(); super.onPause();
this.pictoCategoryGridAdapter.allPictosInGrid(); this.pictoCategoryGridAdapter.allPictosInGrid();
this.pictoMainGridAdapter.allPictosInGrid(); this.pictoMainGridAdapter.allPictosInGrid();
Log.e(LOG_TAG,"onPause*********************");
} }
@Override @Override
...@@ -749,7 +750,7 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular ...@@ -749,7 +750,7 @@ public abstract class VOCA extends Activity implements VocabularyTalk.iVocabular
p.set_mirror(false, false); p.set_mirror(false, false);
// If the picto is a category // If the picto is a category
Log.e(LOG_TAG,"CHILD?"+p.has_child_grid()+" p id:"+p.get_stupicto_id());
if (p.has_child_grid()) { if (p.has_child_grid()) {
currentCategory = p; currentCategory = p;
PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p)); PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment