VOCA class defined

parent 5fb8e46c
Showing with 52 additions and 50 deletions
......@@ -49,7 +49,7 @@
android:label="@string/title_activity_login_activity_fragments"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer"
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
......
......@@ -31,7 +31,7 @@ public class PictoAnimation {
private final static String LOG_TAG = PictoAnimation.class.getCanonicalName();
public void animateTapeView(final VocabularyViewer activity, final int position, final ViewGroup view) {
public void animateTapeView(final VOCA activity, final int position, final ViewGroup view) {
final GridView gridview = (GridView) view.getChildAt(1);
final TapeAdapter tapeAdapter=(TapeAdapter)gridview.getAdapter();
......@@ -104,7 +104,7 @@ public class PictoAnimation {
return argb(alpha, red, green, blue);
}
public void animateTapeViewVertical(final VocabularyViewer activity, final boolean up) {
public void animateTapeViewVertical(final VOCA activity, final boolean up) {
final View v = activity.findViewById(R.id.pictogramLayout);
int y=v.getHeight()/2-activity.tapeGridView.getHeight()/2;
final ValueAnimator moveAnim = up
......@@ -147,7 +147,7 @@ public class PictoAnimation {
public void animateOnDeleteView(final VocabularyViewer activity, View view, final int position) {
public void animateOnDeleteView(final VOCA activity, View view, final int position) {
if (activity.deleting) return;
View borderlayout=((RelativeLayout)view).getChildAt(0);
......@@ -222,7 +222,7 @@ public class PictoAnimation {
public static void animateOnGridView(final RelativeLayout layout) {
final VocabularyViewer activity=(VocabularyViewer)PCBcontext.getActivityContext();
final VOCA activity=(VOCA)PCBcontext.getActivityContext();
if (activity.inserting) return;
FrameLayout borderlayout=(FrameLayout)layout.getChildAt(0);
......@@ -275,7 +275,7 @@ public class PictoAnimation {
public static void animateOutGridView(final PictoGridAdapter pictoGridAdapter, final Picto picto, RelativeLayout layout, final Vector<Picto> pictoLinkedList_inTape) {
final VocabularyViewer activity=(VocabularyViewer)PCBcontext.getActivityContext();
final VOCA activity=(VOCA)PCBcontext.getActivityContext();
if (activity.inserting) return;
FrameLayout borderlayout=(FrameLayout)layout.getChildAt(0);
......
......@@ -73,7 +73,7 @@ public class PictoItemViewGenerator {
}
/**
* Pictogramas no habilitados se muestran sólo en VocabularyManager
*
* @param picto Pictogram to show
* @param convertView View object
* @param parent
......
......@@ -26,7 +26,7 @@ public class PictoMenu {
public static final String IMAGE_PICTO = "imagePicto";
public static final String PATH_SOUND = "pathSound";
VocabularyViewer activity;
VOCA activity;
//Variables used on the picto menu (only supervisors)
private static final int CAMERA_PIC_REQUEST = 1;
......@@ -40,7 +40,7 @@ public class PictoMenu {
// TODO describe this variable
static final int SELECT_PICTURE = 1;
public PictoMenu(VocabularyViewer activity) {
public PictoMenu(VOCA activity) {
this.activity=activity;
}
......@@ -81,7 +81,7 @@ public class PictoMenu {
public void addPicto(int row, int col, int cat, int source) {
//Enviar al VocabularyViewer los datos necesarios para crear el picto despues
//Enviar al VOCA los datos necesarios para crear el picto despues
if (/*PCBcontext.getPcbdb().getCurrentUser().has_categories()*/PCBcontext.getVocabulary().has_categories()) {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.CATEGORY, cat);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
......@@ -107,7 +107,7 @@ public class PictoMenu {
Intent intent = new Intent(activity, EditPictoActivity.class);
intent.putExtra(ID_PICTO_IMAGE,id_picto);
//Enviar al VocabularyViewer los datos necesarios para editar el picto despues
//Enviar al VOCA los datos necesarios para editar el picto despues
if (/*PCBcontext.getPcbdb().getCurrentUser().has_categories()*/PCBcontext.getVocabulary().has_categories()) {
intent.putExtra(Picto.JSON_ATTTRS.CATEGORY, cat);
intent.putExtra(Picto.JSON_ATTTRS.ROW, row);
......
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
/**
* Created by scollado on 19/07/17.
*/
public class VocabularyManager extends VocabularyViewer {
}
......@@ -23,7 +23,6 @@ import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
......@@ -100,7 +99,7 @@ public class SerialActivity extends Activity {
editor.putString("password", supUsers.elementAt(position).get_pwd_sup());
editor.commit();
new UserLogin().login(supUsers.elementAt(position).get_email_sup(),
supUsers.elementAt(position).get_pwd_sup(), SerialActivity.this, VocabularyViewer.class, LoginActivity.class);
supUsers.elementAt(position).get_pwd_sup(), SerialActivity.this, VOCA.class, LoginActivity.class);
}
}
});
......@@ -134,7 +133,7 @@ public class SerialActivity extends Activity {
editor.putString("password", stuUsers.elementAt(position).get_pwd_stu());
editor.commit();
new UserLogin().login(stuUsers.elementAt(position).get_nickname_stu(),
stuUsers.elementAt(position).get_pwd_stu(),SerialActivity.this, VocabularyViewer.class, LoginActivity.class);
stuUsers.elementAt(position).get_pwd_stu(),SerialActivity.this, VOCA.class, LoginActivity.class);
}
});
}
......@@ -173,7 +172,7 @@ public class SerialActivity extends Activity {
editor.putString("password", password);
editor.commit();
if (!username.equals("") && !password.equals(""))
new UserLogin().login(username, password, SerialActivity.this, VocabularyViewer.class, LoginActivity.class);
new UserLogin().login(username, password, SerialActivity.this, VOCA.class, LoginActivity.class);
}
});
......@@ -194,7 +193,7 @@ public class SerialActivity extends Activity {
mSerialViewPass.setText(password);
if (!username.equals("") && !password.equals("") && !getIntent().getBooleanExtra("resetPrevUser", true))
new UserLogin().login(username, password, SerialActivity.this, VocabularyViewer.class, LoginActivity.class);
new UserLogin().login(username, password, SerialActivity.this, VOCA.class, LoginActivity.class);
super.onStart();
try {
......
......@@ -17,7 +17,7 @@ import com.yottacode.net.RestapiWrapper;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......@@ -80,7 +80,7 @@ public class StudentFragmentGrid extends Fragment{
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage());
}
PCBcontext.set_user(currentUser, null, null);
Intent pictogramActivity = new Intent(getActivity(), VocabularyViewer.class);
Intent pictogramActivity = new Intent(getActivity(), VOCA.class);
startActivity(pictogramActivity);
} else {
new_user(i);
......@@ -124,7 +124,7 @@ public class StudentFragmentGrid extends Fragment{
@Override
public void loadComplete() {
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
Intent pictogramActivity = new Intent(getActivity(), VocabularyViewer.class);
Intent pictogramActivity = new Intent(getActivity(), VOCA.class);
startActivity(pictogramActivity);
}
......
......@@ -15,7 +15,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA;
import com.yottacode.pictogram.tabletlibrary.net.SessionWrapper;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
......@@ -116,7 +116,7 @@ public class ListInstructionsFragment extends Fragment{
}
void close() {
ListInstructionsFragment.this.getActivity().finish();
startActivity(new Intent(getActivity(), VocabularyViewer.class));
startActivity(new Intent(getActivity(), VOCA.class));
}
private void checkStudent() {
SessionWrapper.validateStudent(new SessionWrapper.iValidateStudent() {
......
......@@ -21,7 +21,7 @@ import android.widget.ToggleButton;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA;
import com.yottacode.pictogram.tabletlibrary.net.SessionWrapper;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......@@ -273,13 +273,13 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
break;
case MotionEvent.ACTION_UP:
if (event.getX()> firstTouchX+100) { //izquierda->derecha
nextActivity=new Intent(this,VocabularyViewer.class);
nextActivity=new Intent(this,VOCA.class);
nextActivity.putExtra("student_view", false);
in=R.anim.rightin;
out=R.anim.rightout;
}
else if (firstTouchX > event.getX()+100) { //derecha->izquierda
nextActivity=new Intent(this,VocabularyViewer.class);
nextActivity=new Intent(this,VOCA.class);
nextActivity.putExtra("student_view", true);
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(User.NO_SUPERVISOR);
in=R.anim.leftin;
......@@ -345,7 +345,7 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
}
void close() {
finish();
startActivity(new Intent(SessionActivity.this, VocabularyViewer.class));
startActivity(new Intent(SessionActivity.this, VOCA.class));
}
private void set_fragment(boolean isChecked, final ToggleButton onoffBtn) {
if (isChecked) {
......
......@@ -12,7 +12,7 @@ import android.util.Log;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA;
import com.yottacode.pictogram.tools.PCBcontext;
/**
......@@ -25,15 +25,15 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
private static final String LOG_TAG = NetServiceTablet.class.getName();
private static NotificationCompat.Builder builder;
private VocabularyViewer vocabularyViewer;
private VOCA VOCA;
int notifyID = 666;
public void build() {
this.builder = new NotificationCompat.Builder(PCBcontext.getContext()).setAutoCancel(true).setOngoing(PCBcontext.getContext().getResources().getBoolean(R.bool.NotifyAllwaysVisible));
Intent resultIntent = new Intent(PCBcontext.getContext(), VocabularyViewer.class);
Intent resultIntent = new Intent(PCBcontext.getContext(), VOCA.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext());
stackBuilder.addParentStack(VocabularyViewer.class);
stackBuilder.addParentStack(VOCA.class);
stackBuilder.addNextIntent(resultIntent);
if (PCBcontext.getContext().getResources().getBoolean(R.bool.NotifyAllwaysVisible)){
PendingIntent resultPendingIntent =
......@@ -96,8 +96,8 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
context.startActivity(serialActivity);
}
public void setVocabularyViewer(VocabularyViewer vocabularyViewer) {this.vocabularyViewer = vocabularyViewer;}
public void setVOCA(VOCA VOCA) {this.VOCA = VOCA;}
public void updateUserConfig(User user) {
if (this.vocabularyViewer !=null) this.vocabularyViewer.setConfig();
if (this.VOCA !=null) this.VOCA.setConfig();
}
}
......@@ -7,7 +7,7 @@
android:orientation="horizontal"
android:background="#BDBDBD"
android:keepScreenOn="true"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA"
android:padding="@dimen/small_padding">
<RelativeLayout
......
......@@ -7,7 +7,7 @@
android:orientation="horizontal"
android:background="#BDBDBD"
android:keepScreenOn="true"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA"
android:padding="@dimen/small_padding">
<RelativeLayout
......
......@@ -62,13 +62,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" 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/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" />
......@@ -76,6 +69,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" 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/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" />
......@@ -121,5 +121,16 @@
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" exported="" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.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="json-20090211" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -50,7 +50,7 @@
android:label="@string/title_activity_login_activity_fragments"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyViewer"
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.VOCA"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
......
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