Commit cf342414 by Arturo Montejo Ráez

merge

parents 96017d3b 9c55c41d
Showing with 251 additions and 47 deletions
...@@ -7,8 +7,13 @@ android { ...@@ -7,8 +7,13 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 21 targetSdkVersion 21
<<<<<<< HEAD
versionCode 3 versionCode 3
versionName "1.8" versionName "1.8"
=======
versionCode 4
versionName "1.7"
>>>>>>> develop
resValue "string", "db_name", "PCB.db" resValue "string", "db_name", "PCB.db"
resValue "integer", "db_version", "11" resValue "integer", "db_version", "11"
//resValue "string", "app_version", "1.1" //resValue "string", "app_version", "1.1"
...@@ -42,6 +47,7 @@ android { ...@@ -42,6 +47,7 @@ android {
} }
dependencies { dependencies {
<<<<<<< HEAD
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
implementation 'com.android.support:support-v4:24.2.1' implementation 'com.android.support:support-v4:24.2.1'
...@@ -52,4 +58,16 @@ dependencies { ...@@ -52,4 +58,16 @@ dependencies {
implementation 'com.google.android.gms:play-services-ads:9.2.1' implementation 'com.google.android.gms:play-services-ads:9.2.1'
implementation 'com.google.android.gms:play-services-auth:9.2.1' implementation 'com.google.android.gms:play-services-auth:9.2.1'
implementation 'com.google.android.gms:play-services-gcm:9.2.1' implementation 'com.google.android.gms:play-services-gcm:9.2.1'
=======
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.github.nkzawa:socket.io-client:0.5.1'
compile 'com.koushikdutta.async:androidasync:2.+'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.google.android.gms:play-services-ads:9.2.1'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
>>>>>>> develop
} }
...@@ -285,7 +285,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -285,7 +285,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
} }
public void setOffline(Exception e) { public void setOffline(Exception e) {
this.updated=false; if (this.updated)
try {
PCBcontext.getPcbdb().getStudentVocabulary(PCBcontext.getVocabulary());
} catch (JSONException e1) {
Log.e(LOG_TAG,"Local vocabulary when offline not loading:"+e1.getMessage());
}
this.updated=false;
//PCBcontext.getRoom().exit(); //PCBcontext.getRoom().exit();
Log.e(LOG_TAG, "PCB offline because exception happens: " + e.getMessage()); Log.e(LOG_TAG, "PCB offline because exception happens: " + e.getMessage());
notifyStatus(); notifyStatus();
......
...@@ -42,7 +42,7 @@ public class Room { ...@@ -42,7 +42,7 @@ public class Room {
@Override @Override
public void call(Object... args) { public void call(Object... args) {
Log.e(LOG_TAG,"Websockect disconnect"); Log.e(LOG_TAG,"Websockect disconnect");
PCBcontext.getNetService().setOffline(new SocketIOException("Websocket connection is lost")); //PCBcontext.getNetService().setOffline(new SocketIOException("Websocket connection is lost"));
} }
}); });
connect(); connect();
......
/**
* Automatically generated file. DO NOT MODIFY
*/
package com.yottacode.pictogram.communicator;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.yottacode.pictogram.yotta_tablet";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "DevFlavor";
public static final int VERSION_CODE = 7;
public static final String VERSION_NAME = "1.7";
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yottacode.pictogram.yotta_tablet"
android:versionCode="7"
android:versionName="1.7" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="22" />
<!-- The app has the permission to receive the RECEIVE_BOOT_COMPLETED broadcast -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- For kiosk mode -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- For the service that restarts the app when another app go to foreground -->
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<!-- Permissions required for GCM -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:testOnly="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
android:label="@string/title_activity_serial"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.communicator.gui.VOCAC"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<!-- Intent Filter to run the app when the boot is completed -->
<receiver android:name="com.yottacode.pictogram.communicator.BootReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name="com.yottacode.pictogram.communicator.gui.EmptySceneActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:excludeFromRecents="true"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!--
Service handling Google Sign-In user revocation. For apps that do not integrate with
Google Sign-In, this service will never be started.
-->
<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
\ No newline at end of file
...@@ -18,9 +18,15 @@ android { ...@@ -18,9 +18,15 @@ android {
defaultConfig { defaultConfig {
applicationId "com.yottacode.pictogram.supervisor" applicationId "com.yottacode.pictogram.supervisor"
minSdkVersion 21 minSdkVersion 21
<<<<<<< HEAD
targetSdkVersion 26 targetSdkVersion 26
versionCode 8 versionCode 8
versionName "1.8" versionName "1.8"
=======
targetSdkVersion 22
versionCode 7
versionName "1.7"
>>>>>>> develop
resValue "bool","NotifyAllwaysVisible","false" resValue "bool","NotifyAllwaysVisible","false"
resValue "string", "VersionManagerClass", "com.yottacode.pictogram.supervisor.net.VersionManager" resValue "string", "VersionManagerClass", "com.yottacode.pictogram.supervisor.net.VersionManager"
resValue "string","apk","pictograms.apk" resValue "string","apk","pictograms.apk"
......
...@@ -8,19 +8,15 @@ import com.yottacode.pictogram.dao.Picto; ...@@ -8,19 +8,15 @@ import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Vector;
public class PictoGridAdapter extends ArrayAdapter { public class PictoGridAdapter extends ArrayAdapter {
private LinkedList<Picto> pictoLinkedList; private LinkedList<Picto> pictoLinkedList;
private final String LOG_TAG = this.getClass().getSimpleName(); private final String LOG_TAG = this.getClass().getSimpleName();
private Vector<Picto> pictoLinkedList_inTape;
private Vector<Picto> pictoLinkedList_inGrid;
public PictoGridAdapter(LinkedList<Picto> pictoLinkedList){ public PictoGridAdapter(LinkedList<Picto> pictoLinkedList){
super(PCBcontext.getContext(), PictoItemViewGenerator.LAYOUT, pictoLinkedList); super(PCBcontext.getContext(), PictoItemViewGenerator.LAYOUT, pictoLinkedList);
this.pictoLinkedList = pictoLinkedList; this.pictoLinkedList = pictoLinkedList;
pictoLinkedList_inTape=new Vector<>(5);
pictoLinkedList_inGrid=new Vector<>(5);
} }
@Override @Override
...@@ -42,13 +38,6 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -42,13 +38,6 @@ public class PictoGridAdapter extends ArrayAdapter {
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
Picto picto=this.pictoLinkedList.get(position); Picto picto=this.pictoLinkedList.get(position);
int igrid=this.pictoLinkedList_inGrid.indexOf(picto);
int itape = this.pictoLinkedList_inTape.indexOf(picto);
if (itape >= 0)
picto.set_visible(false);
if (igrid>=0)
picto.set_visible(true);
View view = PictoItemViewGenerator.getPictoView( View view = PictoItemViewGenerator.getPictoView(
...@@ -60,13 +49,5 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -60,13 +49,5 @@ public class PictoGridAdapter extends ArrayAdapter {
return view; return view;
} }
public void allPictosInGrid() {
for (Picto picto: pictoLinkedList_inTape) {
pictoLinkedList_inGrid.add(picto);
}
notifyDataSetChanged();
}
} }
...@@ -277,12 +277,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab ...@@ -277,12 +277,7 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
} }
@Override
protected void onPause() {
super.onPause();
this.pictoCategoryGridAdapter.allPictosInGrid();
this.pictoMainGridAdapter.allPictosInGrid();
}
@Override @Override
protected void onStop() { protected void onStop() {
......
...@@ -143,9 +143,13 @@ ...@@ -143,9 +143,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<<<<<<< HEAD
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
=======
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
>>>>>>> develop
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/signing_config" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/signing_config" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
...@@ -157,6 +161,7 @@ ...@@ -157,6 +161,7 @@
</content> </content>
<orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<<<<<<< HEAD
<orderEntry type="library" name="Gradle: com.koushikdutta.async:androidasync:2.2.1@aar" level="project" /> <orderEntry type="library" name="Gradle: com.koushikdutta.async:androidasync:2.2.1@aar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-compat:24.2.1@aar" level="project" /> <orderEntry type="library" name="Gradle: com.android.support:support-compat:24.2.1@aar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-v4:24.2.1@aar" level="project" /> <orderEntry type="library" name="Gradle: com.android.support:support-v4:24.2.1@aar" level="project" />
...@@ -177,6 +182,39 @@ ...@@ -177,6 +182,39 @@
<orderEntry type="library" name="Gradle: com.android.support:support-fragment:24.2.1@aar" level="project" /> <orderEntry type="library" name="Gradle: com.android.support:support-fragment:24.2.1@aar" level="project" />
<orderEntry type="library" name="Gradle: org.json:json:20090211@jar" level="project" /> <orderEntry type="library" name="Gradle: org.json:json:20090211@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils:24.2.1@aar" level="project" /> <orderEntry type="library" name="Gradle: com.android.support:support-core-utils:24.2.1@aar" level="project" />
=======
<orderEntry type="library" name="com.github.nkzawa:socket.io-client:0.5.1@jar" level="project" />
<orderEntry type="library" name="com.android.support:support-annotations:24.2.1@jar" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-basement-9.2.1" level="project" />
<orderEntry type="library" name="com.squareup.okhttp:okhttp:2.4.0@jar" level="project" />
<orderEntry type="library" name="com.android.support:support-fragment-24.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-auth-9.2.1" level="project" />
<orderEntry type="library" name="com.koushikdutta.async:androidasync-2.2.1" level="project" />
<orderEntry type="library" name="com.android.support:support-v4-24.2.1" level="project" />
<orderEntry type="library" name="com.google.code.gson:gson:2.3@jar" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-iid-9.2.1" level="project" />
<orderEntry type="library" name="com.github.nkzawa:engine.io-client:0.5.1@jar" level="project" />
<orderEntry type="library" name="com.android.support:animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-base-9.2.1" level="project" />
<orderEntry type="library" name="com.koushikdutta.ion:ion-2.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" name="com.android.support:support-media-compat-24.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-gass-9.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" name="org.json:json:20090211@jar" level="project" />
<orderEntry type="library" name="com.android.support:support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" name="com.android.support:support-core-utils-24.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-ads-9.2.1" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" name="pl.droidsonroids.gif:android-gif-drawable-1.1.7" level="project" />
<orderEntry type="library" name="com.squareup.okio:okio:1.4.0@jar" level="project" />
<orderEntry type="library" name="com.google.android.gms:play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="library" name="com.android.support:appcompat-v7-24.2.1" level="project" />
<orderEntry type="library" name="com.android.support:support-core-ui-24.2.1" level="project" />
<orderEntry type="library" name="com.squareup.okhttp:okhttp-ws:2.4.0@jar" level="project" />
<orderEntry type="library" name="com.android.support:support-compat-24.2.1" level="project" />
>>>>>>> develop
<orderEntry type="module" module-name="commonlibrary" /> <orderEntry type="module" module-name="commonlibrary" />
<orderEntry type="module" module-name="tabletlibrary" /> <orderEntry type="module" module-name="tabletlibrary" />
</component> </component>
......
...@@ -39,16 +39,22 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -39,16 +39,22 @@ public class PictoGridAdapter extends ArrayAdapter {
return 0; return 0;
} }
private void set_visible(Picto picto, boolean visible) {
if (PCBcontext.getVocabulary().get_picto(picto.get_grid(),picto.get_ImgId())!=null)
PCBcontext.getVocabulary().get_picto(picto.get_grid(),picto.get_ImgId()).set_visible(visible);
}
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
Picto picto=this.pictoLinkedList.get(position); Picto picto= this.pictoLinkedList.get(position)==null ? null
int igrid=this.pictoLinkedList_inGrid.indexOf(picto); : PCBcontext.getVocabulary().get_picto(this.pictoLinkedList.get(position).get_grid(),this.pictoLinkedList.get(position).get_ImgId());
int itape = this.pictoLinkedList_inTape.indexOf(picto); int igrid=this.pictoLinkedList_inGrid.indexOf(picto);
int itape = this.pictoLinkedList_inTape.indexOf(picto);
if (itape >= 0) if (itape >= 0)
picto.set_visible(false); set_visible(picto,false);
if (igrid>=0) if (igrid>=0)
picto.set_visible(true); set_visible(picto,true);
View view = PictoItemViewGenerator.getPictoView( View view = PictoItemViewGenerator.getPictoView(
...@@ -72,7 +78,7 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -72,7 +78,7 @@ public class PictoGridAdapter extends ArrayAdapter {
public void pictoInGrid(Picto p) { public void pictoInGrid(Picto p) {
p.set_visible(true); set_visible(p,true);
pictoLinkedList_inGrid.add(p); pictoLinkedList_inGrid.add(p);
notifyDataSetChanged(); notifyDataSetChanged();
} }
...@@ -84,7 +90,7 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -84,7 +90,7 @@ public class PictoGridAdapter extends ArrayAdapter {
public void allPictosInGrid() { public void allPictosInGrid() {
for (Picto picto: pictoLinkedList_inTape) for (Picto picto: pictoLinkedList_inTape)
picto.set_visible(true); set_visible(picto,true);
pictoLinkedList_inTape.clear(); pictoLinkedList_inTape.clear();
pictoLinkedList_inGrid.clear(); pictoLinkedList_inGrid.clear();
......
...@@ -5,6 +5,8 @@ import android.content.Context; ...@@ -5,6 +5,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
...@@ -14,6 +16,7 @@ import android.view.inputmethod.InputMethodManager; ...@@ -14,6 +16,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
...@@ -145,7 +148,17 @@ public class SerialActivity extends Activity { ...@@ -145,7 +148,17 @@ public class SerialActivity extends Activity {
} }
}); });
}
((ImageButton)findViewById(R.id.viewPwdButton)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mSerialViewPass.setTransformationMethod(mSerialViewPass.getTransformationMethod().equals(PasswordTransformationMethod.getInstance())
? HideReturnsTransformationMethod.getInstance()
:PasswordTransformationMethod.getInstance());
}});
}
private void clearWindow() { private void clearWindow() {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
......
...@@ -54,17 +54,19 @@ ...@@ -54,17 +54,19 @@
android:background="@drawable/edit_text_login_style" android:background="@drawable/edit_text_login_style"
android:fontFamily="monospace" android:fontFamily="monospace"
android:hint="@string/prompt_serial_mail" android:hint="@string/prompt_serial_mail"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified" android:imeOptions="actionUnspecified"
android:inputType="text" android:inputType="text"
android:maxLines="1" android:maxLines="1"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:selectAllOnFocus="false" android:selectAllOnFocus="false"
android:textColorLink="@color/blue" /> android:textColorLink="@color/blue" />
<LinearLayout
android:layout_width="350dp"
android:layout_height="wrap_content">
<EditText <EditText
android:id="@+id/serialpass" android:id="@+id/serialpass"
android:layout_width="350dp" android:layout_width="325dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/serialmail" android:layout_below="@+id/serialmail"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
...@@ -72,7 +74,6 @@ ...@@ -72,7 +74,6 @@
android:background="@drawable/edit_text_login_style" android:background="@drawable/edit_text_login_style"
android:fontFamily="monospace" android:fontFamily="monospace"
android:hint="@string/prompt_serial_pass" android:hint="@string/prompt_serial_pass"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_entrar" android:imeActionLabel="@string/action_entrar"
android:imeOptions="actionUnspecified" android:imeOptions="actionUnspecified"
android:inputType="textPassword" android:inputType="textPassword"
...@@ -82,6 +83,17 @@ ...@@ -82,6 +83,17 @@
android:singleLine="false" android:singleLine="false"
android:textColorLink="@color/blue" /> android:textColorLink="@color/blue" />
<ImageButton
android:id="@+id/viewPwdButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@android:color/transparent"
android:baselineAlignBottom="false"
android:elevation="0dp"
android:clickable="true"
android:src="@drawable/ic_remove_red_eye_black_24dp" />
</LinearLayout>
<Button <Button
android:id="@+id/entrar_button" android:id="@+id/entrar_button"
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
...@@ -97,6 +109,7 @@ ...@@ -97,6 +109,7 @@
android:text="@string/action_entrar" android:text="@string/action_entrar"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
......
...@@ -89,9 +89,11 @@ module.exports = { ...@@ -89,9 +89,11 @@ module.exports = {
.populate('tags', {lang: student.lang}) .populate('tags', {lang: student.lang})
.then((picto) => { .then((picto) => {
// check picto has expressions associated in student language // check picto has expressions associated manually or associated in student language
if (picto.expressions.length == 0 || picto.expressions[0].text.length == 0) if (!stuPicto.attributes.expression & (picto.expressions.length == 0 || picto.expressions[0].text.length == 0))
return next_cb(); stuPicto.attributes.expression = sails.__({
phrase: 'undef_label',
locale: student.lang});
// check picto image is available // check picto image is available
picto.imageFileExists(function(found) { picto.imageFileExists(function(found) {
......
...@@ -3,8 +3,8 @@ module.exports = function isAdmin (req, res, next) { ...@@ -3,8 +3,8 @@ module.exports = function isAdmin (req, res, next) {
// //
// Only if the user that has connected is global administrator (Yotta employee) // Only if the user that has connected is global administrator (Yotta employee)
// //
if (!req.token || req.token.role !== 'admin') if (!req.token || !req.token.isAdmin)
res.json(401, {error: 'Access denied'}); res.json(401, {error: 'Access denied. You\'re not admin!'});
// Finally, if the user has a clean record, we'll call the `next()` function // Finally, if the user has a clean record, we'll call the `next()` function
// to let them through to the next policy or our controller // to let them through to the next policy or our controller
......
...@@ -15,5 +15,6 @@ ...@@ -15,5 +15,6 @@
"tutor_office_request": "{{{ name }}}, with email {{{ email }}}, is requesting to be linked as tutor/father/mother to any of your students.", "tutor_office_request": "{{{ name }}}, with email {{{ email }}}, is requesting to be linked as tutor/father/mother to any of your students.",
"Welcome": "Welcome", "Welcome": "Welcome",
"welcome_msg1": "Welcome to Pictogram, {{{ name }}}!", "welcome_msg1": "Welcome to Pictogram, {{{ name }}}!",
"welcome_msg2": "Your account is now active. You can proceed to" "welcome_msg2": "Your account is now active. You can proceed to",
"undef_label": "WARNING: specify English expression"
} }
...@@ -15,5 +15,6 @@ ...@@ -15,5 +15,6 @@
"tutor_office_request": "El/la tutor/a/padre/madre {{{ name }}}, con correo electrónico {{{ email }}}, pide ser asociado a algún estudiante.", "tutor_office_request": "El/la tutor/a/padre/madre {{{ name }}}, con correo electrónico {{{ email }}}, pide ser asociado a algún estudiante.",
"Welcome": "Bienvenido", "Welcome": "Bienvenido",
"welcome_msg1": "¡Bienvenido a Pictogram, {{{ name }}}!", "welcome_msg1": "¡Bienvenido a Pictogram, {{{ name }}}!",
"welcome_msg2": "Su cuenta está ahora activa, por lo que puede" "welcome_msg2": "Su cuenta está ahora activa, por lo que puede",
"undef_label": "ATENCIÓN: Especifique expresión en español"
} }
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