Commit da6bcac0 by Fernando Martínez Santiago

Merge branch 'fernando_branch' of http://scm.ujaen.es/softuno/pictogram into develop

parents 13739838 a007406e
Showing with 412 additions and 160 deletions
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
......@@ -8,8 +8,8 @@ import android.util.Log;
import com.yottacode.net.RestapiWrapper;
import com.yottacode.net.iRestapiListener;
import com.yottacode.pictogram.R;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.ServerLogin;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......@@ -229,7 +229,7 @@ public class UserLogin {
public void set_student_oline(final User student, String token, final Intent pictogramActivity, final Activity activity) {
final ProgressDialog progressDialog=ProgressDialog.show(activity, activity.getString(R.string.userLoadingTxt),activity. getString(R.string.loadingGrammar));
PCBcontext.set_user(student, token, new iImgDownloaderListener() {
PCBcontext.set_user(student, token, new ImgDownloader.iImgDownloaderListener() {
@Override
public void loadComplete() {
PCBcontext.getDevice().insertUser(student);
......
......@@ -9,12 +9,9 @@ import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.net.websockets.ActionTalk;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.net.websockets.VocabularyTalk;
import com.yottacode.pictogram.net.websockets.iActionListener;
import com.yottacode.pictogram.net.websockets.iVocabularyListener;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......@@ -41,14 +38,14 @@ public class Vocabulary implements Iterable<Picto> {
Hashtable<Integer,LinkedList<Picto>> pictos;
static int DEFAULT_VOCABULARY_SIZE=200;
iImgDownloaderListener imgListener;
ImgDownloader.iImgDownloaderListener imgListener;
/**
* Creates a new vocabulary and download/load the vocabulary and the corresponding pictos
* @param listener
*/
public Vocabulary(iImgDownloaderListener listener) {
public Vocabulary(ImgDownloader.iImgDownloaderListener listener) {
this.pictos = new Hashtable<>(Vocabulary.DEFAULT_VOCABULARY_SIZE);
this.imgListener=listener;
if (PCBcontext.getNetService().online()) {
......@@ -64,8 +61,8 @@ public class Vocabulary implements Iterable<Picto> {
}
}
public void listen(Room room, iVocabularyListener listener, iActionListener action_listener) {
iVocabularyListener vocabulary_listeners[] = {new iVocabularyListener() {
public void listen(Room room, VocabularyTalk.iVocabularyListener listener, ActionTalk.iActionListener action_listener) {
VocabularyTalk.iVocabularyListener vocabulary_listeners[] = {new VocabularyTalk.iVocabularyListener() {
@Override
public void change(action action, int picto_cat, int picto_id, JSONObject args) {
switch (action) {
......@@ -103,7 +100,7 @@ public class Vocabulary implements Iterable<Picto> {
}
},listener};
new VocabularyTalk(room, vocabulary_listeners);
new ActionTalk(room, new iActionListener[] {action_listener});
new ActionTalk(room, new ActionTalk.iActionListener[] {action_listener});
}
......@@ -247,7 +244,7 @@ public class Vocabulary implements Iterable<Picto> {
public void addPicto(Picto pic, ImgDownloader.tsource source){
addPicto(pic, source, this.imgListener);
}
public void addPicto(Picto pic, ImgDownloader.tsource source, iImgDownloaderListener imgListener){
public void addPicto(Picto pic, ImgDownloader.tsource source, ImgDownloader.iImgDownloaderListener imgListener){
Vector<Img> imgs=new Vector<Img>(1);
imgs.add(new Img(pic.get_id(), pic.get_url(), Img.VOCABULARY));
......@@ -259,7 +256,7 @@ public class Vocabulary implements Iterable<Picto> {
PCBcontext.getPcbdb().addPicto(pic);
}
public void setImgDownloaderListener(iImgDownloaderListener listener) {
public void setImgDownloaderListener(ImgDownloader.iImgDownloaderListener listener) {
this.imgListener=listener;
}
......@@ -383,7 +380,7 @@ public class Vocabulary implements Iterable<Picto> {
final Picto picto[]=new Picto[1];
try {
picto[0] = new Picto(id, url, exp, cat, coord_x, coord_y, free_category_coord_x, free_category_coord_y);
addPicto(picto[0], ImgDownloader.tsource.local, new iImgDownloaderListener() {
addPicto(picto[0], ImgDownloader.tsource.local, new ImgDownloader.iImgDownloaderListener() {
@Override
public void loadComplete() {
listener.saved(picto[0]);
......
......@@ -8,7 +8,6 @@ import android.util.Log;
import com.yottacode.pictogram.R;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import java.io.File;
import java.io.FileInputStream;
......@@ -117,4 +116,13 @@ public class ImgDownloader extends AsyncTask<Vector<Img>, Void, Img> {
else imgListener.loadImg(img);
}
/**
* Created by emblanco on 24/09/15.
* MOdified by dofer on 27/06/16.
*/
public static interface iImgDownloaderListener {
public void loadComplete(); // for loading the vocabulary
public void loadImg(Img image); // for loading one image
public void error(Exception err); //error happens
}
}
......@@ -162,4 +162,17 @@ public class NetService implements Runnable {
public iNetServiceDevice getNetServiceDevice() {
return this.device;
}
/**
* Created by Fernando on 12/08/2016.
*/
public static interface iNetServiceDevice {
public void build();
public void notifyStatus(boolean updated);
public void closeNotifyStatus();
public void restart_app(boolean direct_login);
public void restart_app(Intent intent, boolean direct_login);
public void updateUserConfig(User user);
}
}
......@@ -2,9 +2,7 @@ package com.yottacode.pictogram.net;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.widget.Toast;
import com.google.gson.JsonObject;
import com.koushikdutta.ion.Ion;
......@@ -15,7 +13,6 @@ import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.BitmapTools;
import com.yottacode.tools.GUITools;
import org.json.JSONArray;
......@@ -258,4 +255,10 @@ public class PictoUploader {
}
/**
* Created by Fernando on 28/07/2016.
*/
public static interface iPictoUploaderListener {
void success(boolean success);
}
}
package com.yottacode.pictogram.net;
import com.yottacode.net.iRestapiListener;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Created by Fernando on 16/12/2016.
*/
public class SessionWrapper {
interface iSessionWrapper {
void methods(JSONObject methods);
void error(String error);
}
iSessionWrapper listener;
SessionWrapper(iSessionWrapper listener) {
this.listener=listener;
}
void getMethods() {
int id=PCBcontext.getPcbdb().getCurrentUser().get_id_stu();
PCBcontext.getRestapiWrapper().ask("/stu/student/" + id, new iRestapiListener() {
@Override
public void preExecute() {
}
@Override
public void result(JSONArray result) {
}
@Override
public void result(JSONObject result) {
listener.methods(result);
}
@Override
public void error(Exception e) {
listener.error(e.getMessage());
}
});
}
}
package com.yottacode.pictogram.net;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.Img;
import java.util.LinkedList;
/**
* Created by emblanco on 24/09/15.
* MOdified by dofer on 27/06/16.
*/
public interface iImgDownloaderListener {
public void loadComplete(); // for loading the vocabulary
public void loadImg(Img image); // for loading one image
public void error(Exception err); //error happens
}
package com.yottacode.pictogram.net;
import android.content.Intent;
import com.yottacode.pictogram.dao.User;
/**
* Created by Fernando on 12/08/2016.
*/
public interface iNetServiceDevice {
public void build();
public void notifyStatus(boolean updated);
public void closeNotifyStatus();
public void restart_app(boolean direct_login);
public void restart_app(Intent intent, boolean direct_login);
public void updateUserConfig(User user);
}
package com.yottacode.pictogram.net;
/**
* Created by Fernando on 28/07/2016.
*/
public interface iPictoUploaderListener {
void success(boolean success);
}
......@@ -62,4 +62,14 @@ public class ActionTalk implements Emitter.Listener {
}
}
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public interface iActionListener {
enum action {add,select}
void action(action action, int picto_cat, int picto_id);
}
}
......@@ -57,4 +57,13 @@ public class StudentTalk implements Emitter.Listener {
}
}
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public static interface iStudentListener {
public void change(User updatedStudent);
}
}
......@@ -61,4 +61,14 @@ public class VocabularyTalk implements Emitter.Listener {
}
}
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public static interface iVocabularyListener {
public enum action {delete,add,update}
public void change(action action, int picto_cat, int picto_id, JSONObject args);
}
}
package com.yottacode.pictogram.net.websockets;
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public interface iActionListener {
public enum action {add,select}
public void action(iActionListener.action action, int picto_cat, int picto_id);
}
package com.yottacode.pictogram.net.websockets;
import com.yottacode.pictogram.dao.User;
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public interface iStudentListener {
public void change(User updatedStudent);
}
package com.yottacode.pictogram.net.websockets;
import org.json.JSONObject;
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public interface iVocabularyListener {
public enum action {delete,add,update}
public void change(iVocabularyListener.action action, int picto_cat, int picto_id, JSONObject args);
}
......@@ -11,12 +11,10 @@ import com.yottacode.pictogram.dao.Device;
import com.yottacode.pictogram.dao.PCBDBHelper;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.net.websockets.StudentTalk;
import com.yottacode.pictogram.net.websockets.iStudentListener;
public final class PCBcontext {
private static Context context;
......@@ -35,7 +33,7 @@ public final class PCBcontext {
* Init method for passing params to the singleton
* @param c @TODO application or activity context?
*/
public static void init(Context c, iNetServiceDevice listener){
public static void init(Context c, NetService.iNetServiceDevice listener){
if (!init) {
init = true;
context = c;
......@@ -56,7 +54,7 @@ public final class PCBcontext {
* @param student
* @param listener
*/
public static void set_user(User student, String token, iImgDownloaderListener listener) {
public static void set_user(User student, String token, ImgDownloader.iImgDownloaderListener listener) {
if (!init) {
Log.i(PCBcontext.class.getCanonicalName(), "PCBcontext.init must be called once previously ");
throw new java.lang.AssertionError("init must be called once previously ");
......@@ -70,7 +68,7 @@ public final class PCBcontext {
actionLog = new ActionLog();
vocabulary = new Vocabulary(listener);
getNetService().notifyStatus();
if (getNetService().online()) new StudentTalk(room, new iStudentListener[] {new iStudentListener() {
if (getNetService().online()) new StudentTalk(room, new StudentTalk.iStudentListener[] {new StudentTalk.iStudentListener() {
@Override
public void change(User updatedStudent) {
PCBcontext.getDevice().insertUser(updatedStudent);
......
......@@ -43,13 +43,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" />
......@@ -58,6 +51,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" />
......@@ -145,7 +145,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
......
......@@ -8,7 +8,7 @@ android {
targetSdkVersion 22
versionCode 1
versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
resValue "string", "SerialClass", "com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
resValue "integer", "rows_big", "4"
......@@ -27,8 +27,8 @@ android {
}
dependencies {
compile 'com.android.support:appcompat-v7:24.+'
compile 'com.android.support:support-v4:24.1.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':commonlibrary')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
}
......@@ -14,7 +14,6 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
......@@ -86,7 +85,7 @@ public class LoginActivity extends FragmentActivity {
this.getIntent().getStringExtra("pic"),
Img.SUPERVISOR
));
ImgDownloader downloader = new ImgDownloader(this, new iImgDownloaderListener() {
ImgDownloader downloader = new ImgDownloader(this, new ImgDownloader.iImgDownloaderListener() {
@Override
public void loadComplete() {
try {
......
......@@ -39,11 +39,11 @@ import com.yottacode.pictogram.action.TalkAction;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.net.websockets.iActionListener;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.websockets.ActionTalk;
import com.yottacode.pictogram.grammar.iLocalPicto;
import com.yottacode.pictogram.net.websockets.iVocabularyListener;
import com.yottacode.pictogram.net.websockets.VocabularyTalk;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.Img;
......@@ -63,7 +63,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class PictogramActivity extends Activity implements iVocabularyListener {
public class PictogramActivity extends Activity implements VocabularyTalk.iVocabularyListener {
public static final String PREFS_NAME = "MyPrefsFile";
// Main layout for this activity
......@@ -127,7 +127,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
}
this.vocabulary = PCBcontext.getVocabulary();
this.vocabulary.listen(PCBcontext.getRoom(), this, new iActionListener() {
this.vocabulary.listen(PCBcontext.getRoom(), this, new ActionTalk.iActionListener() {
@Override
public void action(action action, int picto_cat, int picto_id) {
Log.i(this.getClass().getCanonicalName(), action + " from " + picto_cat + "," + picto_id + " catched");
......@@ -135,7 +135,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener {
PictogramActivity.this.execHighligthFeeback(picto, true);
}
});
this.vocabulary.setImgDownloaderListener(new iImgDownloaderListener() {
this.vocabulary.setImgDownloaderListener(new ImgDownloader.iImgDownloaderListener() {
@Override
public void loadComplete() {
PictogramActivity.this.refresh();
......
......@@ -17,7 +17,6 @@ import com.yottacode.net.RestapiWrapper;
import com.yottacode.net.iRestapiListener;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity;
import com.yottacode.pictogram.tools.Img;
......@@ -114,7 +113,7 @@ public class StudentFragmentGrid extends Fragment{
Log.i(this.getClass().getCanonicalName(),"Loading vocabulary for "+new_user.get_name_stu());
progressDialog=ProgressDialog.show(getActivity(), getString(R.string.loadingGrammar),
getString(R.string.userLoadingTxt), false, false);
PCBcontext.set_user(new_user, intent.getStringExtra("token"), new iImgDownloaderListener() {
PCBcontext.set_user(new_user, intent.getStringExtra("token"), new ImgDownloader.iImgDownloaderListener() {
@Override
public void loadComplete() {
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
......@@ -166,7 +165,7 @@ public class StudentFragmentGrid extends Fragment{
} //for
progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg),
getString(R.string.userLoadingTxt), false, false);
ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() {
ImgDownloader downloader = new ImgDownloader(getActivity(), new ImgDownloader.iImgDownloaderListener() {
private void loaded() {
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
......
package com.yottacode.pictogram.tabletlibrary.gui.session;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.yottacode.pictogram.tabletlibrary.R;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link SessionFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link SessionFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SessionFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public SessionFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment SessionFragment.
*/
// TODO: Rename and change types and number of parameters
public static SessionFragment newInstance(String param1, String param2) {
SessionFragment fragment = new SessionFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_session, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
......@@ -6,7 +6,7 @@ import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
......@@ -18,7 +18,7 @@ import com.yottacode.pictogram.tools.PCBcontext;
* @version 1.0
*/
public class NetServiceTablet implements iNetServiceDevice {
public class NetServiceTablet implements NetService.iNetServiceDevice {
private static NotificationCompat.Builder builder;
private PictogramActivity pictogramActivity;
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".gui.SerialActivity">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".gui.SerialActivity">
<EditText
android:id="@+id/serialmail"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/sessionTopbarLayout">
<TextView
android:text="Seleccione instrucción y fase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:textStyle="bold" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:layout_below="@+id/sessionTopbarLayout">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="4">
<TextView
android:text="Fases"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="normal|bold" />
<ListView
android:id="@+id/stepsInstructionsListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center|center_horizontal"
android:padding="32dp"
android:horizontalSpacing="16dp"
android:verticalSpacing="16dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="6">
<TextView
android:text="Instrucción"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="normal|bold" />
<ListView
android:id="@+id/instructionsListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center|center_horizontal"
android:padding="32dp"
android:horizontalSpacing="16dp"
android:verticalSpacing="16dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ListLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.session.SessionFragment">
<!-- TODO: Update blank fragment layout -->
<GridView
android:id="@+id/tape_grid_view"
android:layout_width="@dimen/picto_big_width"
android:layout_height="@dimen/tape_big_height"
android:padding="@dimen/small_padding"
android:gravity="center"
android:numColumns="6"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="true"
android:longClickable="true"
android:horizontalSpacing="@dimen/picto_grid_spacing"
tools:targetApi="ice_cream_sandwich">
</GridView>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_not_evaluated" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_correct" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_supervised" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_spontaneous" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_fail" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_discarded" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_model" />
</LinearLayout>
</ListLayout>
......@@ -2,4 +2,7 @@
<string name="app_name">com.yottacode.pictogram.Tablet</string>
<item name="maxInTape" type="integer">8</item>
<item name="maxInTape_big" type="integer">6</item>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
......@@ -73,14 +73,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
......@@ -89,6 +81,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
......
package com.yottacode.pictogram.watch.gui;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.wearable.view.WatchViewStub;
import android.util.Log;
import android.widget.TextView;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.watch.R;
import com.yottacode.pictogram.watch.net.NetServiceWatch;
......
......@@ -5,7 +5,7 @@ import android.util.Log;
import android.widget.TextView;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.watch.R;
......@@ -16,7 +16,7 @@ import com.yottacode.pictogram.watch.R;
* @version 1.0
*/
public class NetServiceWatch implements iNetServiceDevice {
public class NetServiceWatch implements NetService.iNetServiceDevice {
TextView status;
Class Activity;
......
......@@ -106,14 +106,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
......@@ -122,6 +114,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
......
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