issues #623, #612, #622 closed. "Supervisor" label included in login window

parent 23b27d26
Showing with 2435 additions and 115 deletions
...@@ -3,28 +3,24 @@ package com.yottacode.pictogram.dao; ...@@ -3,28 +3,24 @@ package com.yottacode.pictogram.dao;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log; import android.util.Log;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Vector;
import com.yottacode.pictogram.R; import com.yottacode.pictogram.R;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.action.Action; import com.yottacode.pictogram.action.Action;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.InputStream;
import java.util.Calendar;
import java.util.Vector;
/** /**
* Platform abstraction (Android) * Platform abstraction (Android)
* @see PCBDBHelper * @see PCBDBHelper
......
package com.yottacode.pictogram.supervisor_tablet.gui;
import android.app.Activity;
import com.yottacode.pictogram.supervisor_tablet.R;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
import com.yottacode.tools.GUITools;
/**
* Created by Fernando on 21/11/2016.
*/
public final class Supervisor_SerialActivity extends SerialActivity {
@Override
protected boolean is_legal_user(String user_name, Activity activity) {
boolean legal_user=com.yottacode.pictogram.dao.UserLogin.isSupervisorLoginPattern(user_name);
if (!legal_user)
GUITools.show_alert(activity, R.string.ilegal_user, user_name);
return legal_user;
}
}
<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.Supervisor_SerialActivity">
<EditText
android:id="@+id/serialmail"
android:layout_width="400px"
android:layout_height="wrap_content"
android:hint="@string/prompt_serial_mail"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:layout_alignParentTop="true" />
<EditText
android:id="@+id/serialpass"
android:layout_width="400px"
android:layout_height="wrap_content"
android:hint="@string/prompt_serial_pass"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_entrar"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:layout_below="@+id/serialmail"
/>
<Button
android:id="@+id/entrar_button" style="?android:textAppearanceSmall"
android:layout_width="400px"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_entrar"
android:textStyle="bold"
android:layout_below="@+id/serialpass"/>
<ImageView
android:layout_width="200px"
android:layout_height="120px"
android:layout_marginLeft="30px"
android:orientation="horizontal"
android:src="@drawable/pictogram_logo"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/serialmail"
/>
<TextView
android:text="SUPERVISOR"
android:textColor="@color/green"
android:layout_width="200px"
android:layout_height="50px"
android:layout_marginLeft="20px"
android:orientation="horizontal"
android:id="@+id/textView3"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_below="@+id/imageView"
android:layout_alignStart="@+id/imageView" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Pictogram Tablet Supervisor</string>
<string name="ilegal_user">There is not any supervisor named</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Pictogram Tablet Supervisor</string>
<string name="ilegal_user"> No existe ningún supervisor </string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Pictogram Tablet Supervisor</string>
<string name="ilegal_user">There is not any supervisor named</string>
</resources>
...@@ -43,13 +43,6 @@ ...@@ -43,13 +43,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" />
...@@ -58,6 +51,13 @@ ...@@ -58,6 +51,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" />
...@@ -66,14 +66,6 @@ ...@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/assets" type="java-test-resource" />
...@@ -82,6 +74,14 @@ ...@@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
...@@ -106,14 +106,6 @@ ...@@ -106,14 +106,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <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/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" 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/assets" type="java-test-resource" />
...@@ -122,6 +114,14 @@ ...@@ -122,6 +114,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" 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/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" 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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
......
apply plugin: 'com.android.library'
android {
compileSdkVersion 24
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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')
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\Fernando\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yottacode.pictogram.tabletlibrary">
<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">
</application>
</manifest>
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.yottacode.pictogram.tabletlibrary.R;
import java.util.Vector;
/**
* Creates a View for each student on the list with a photo and his/her name.
* It uses list_single.xml for the layout creation.
*/
public class CustomList extends ArrayAdapter<String>{
private final Activity context;
private final String[] name_surname;
private final Vector<Bitmap> images;
/**
* @param context Context used for rendering the view
* @param name_surname List of students' names
* @param images List of students' photos
*/
public CustomList(Activity context,
String[] name_surname, Vector<Bitmap> images) {
super(context, R.layout.list_single, name_surname);
this.context = context;
this.name_surname = name_surname;
this.images = images;
}
/**
* @param position Student position in the name_surname/images arrays
* @param view @TODO not being used
* @param parent @TODO not being used
* @return The rendered student view
*/
@Override
public View getView(int position, View view, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View rowView= inflater.inflate(R.layout.list_single, null, true);
TextView txtTitle = (TextView) rowView.findViewById(R.id.loginStudentName);
ImageView imageView = (ImageView) rowView.findViewById(R.id.loginStudentPhoto);
txtTitle.setText(name_surname[position]);
//imageView.setImageResource(R.drawable.user);
if (images.size()>0) imageView.setImageBitmap(images.elementAt(position));
else imageView.setImageResource(R.drawable.anonymous_student);
return rowView;
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
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;
import com.yottacode.tools.GUITools;
import java.io.IOException;
import java.util.Vector;
/**
* LoginActivity show the login window to select the student and supervisor
* It uses device to read the token value
*/
public class LoginActivity extends FragmentActivity {
// String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
/**
* If there is Internet connection it calls the WS to recover the pairs student-supervisor
* @param savedInstanceState
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(com.yottacode.pictogram.tabletlibrary.R.layout.activity_login);
// Enable logout button
final Button logoutButton = (Button) findViewById(R.id.loginTopbarLogout);
logoutButton.setEnabled(true);
logoutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Class serialClass;
try {
serialClass=Class.forName(getString(R.string.SerialClass));
} catch (ClassNotFoundException e) {
Log.e(this.getClass().getCanonicalName(),"S:"+getString(R.string.SerialClass));
serialClass=SerialActivity.class;
}
Intent serialActivity = new Intent(getBaseContext(), serialClass);
serialActivity.putExtra("resetPrevUser", true);
startActivity(serialActivity);
}
});
}
@Override
protected void onStart() {
super.onStart();
// Set supervisor information on topbar
final TextView supervisorFullNameView = (TextView) findViewById(R.id.loginTopbarSupervisorFullName);
final TextView supervisorUserNameView = (TextView) findViewById(R.id.loginTopbarSupervisorUserName);
final ImageView supervisorPhotoView = (ImageView) findViewById(R.id.loginTopbarSupervisorPhoto);
supervisorFullNameView.setText(
this.getIntent().getStringExtra("name") + " " +
this.getIntent().getStringExtra("surname"));
supervisorUserNameView.setText(this.getIntent().getStringExtra("email"));
final Vector<Img> imgs = new Vector<>(1);
imgs.add(new Img(
this.getIntent().getIntExtra("sup_id", -1),
this.getIntent().getStringExtra("pic"),
Img.SUPERVISOR
));
ImgDownloader downloader = new ImgDownloader(this, new iImgDownloaderListener() {
@Override
public void loadComplete() {
try {
supervisorPhotoView.setImageBitmap(
imgs.get(0).get_bitmap(PCBcontext.getContext())
);
supervisorPhotoView.invalidate();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void loadImg(Img image) {}
@Override
public void error(Exception e) {
GUITools.show_alert(PCBcontext.getContext(), R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "Server error:"+ e.getLocalizedMessage());
}
}, ImgDownloader.tsource.remote);
downloader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, imgs);
}
@Override
protected void onStop() {
super.onStop();
Log.i(LOG_TAG,"Closing app");
PCBcontext.getNetService().closeNotifyStatus();
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
public class MainActivity extends Activity {
// String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
// For deactivating the lock screen (just before setContentView)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
PCBcontext.init(this, new NetServiceTablet());
Class serialClass;
try {
serialClass=Class.forName(getString(R.string.SerialClass));
} catch (ClassNotFoundException e) {
Log.e(this.getClass().getCanonicalName(),"S:"+getString(R.string.SerialClass));
serialClass=SerialActivity.class;
}
Intent serialActivity = new Intent(this, serialClass);
serialActivity.putExtra("resetPrevUser", false);
startActivity(serialActivity);
}
@Override
protected void onStop() {
super.onStop();
Log.i(LOG_TAG,"Closing app");
PCBcontext.getNetService().closeNotifyStatus();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext;
import java.util.LinkedList;
public class PictoGridAdapter extends ArrayAdapter {
private LinkedList<Picto> pictoLinkedList;
private final String LOG_TAG = this.getClass().getSimpleName();
public PictoGridAdapter(LinkedList<Picto> pictoLinkedList){
super(PCBcontext.getContext(), PictoItemViewGenerator.LAYOUT, pictoLinkedList);
this.pictoLinkedList = pictoLinkedList;
}
@Override
public int getCount() {
return this.pictoLinkedList.size();
}
@Override
public Picto getItem(int position) {
return this.pictoLinkedList.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
public void deleteAll() {
this.pictoLinkedList.clear();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return PictoItemViewGenerator.getPictoView(
this.pictoLinkedList.get(position),
convertView,
parent
);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void ttsPicto(Picto p, TextToSpeech tts) {
if (p.is_enabled()) {
String input = p.get_translation();
Bundle params = new Bundle();
params.putString(TextToSpeech.Engine.KEY_PARAM_VOLUME, "1");
tts.speak(input, TextToSpeech.QUEUE_FLUSH, params, null);
}
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
import java.io.IOException;
/**
* This class is used for generating PictoViews which will be inserted inside a picto grid
* or a picto tape.
*/
public class PictoItemViewGenerator {
public static final int LAYOUT = R.layout.picto_grid_item;
public static View getPictoView(Picto picto, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(LAYOUT, parent, false);
}
RelativeLayout layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper);
FrameLayout layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout);
ImageView pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image);
ImageView redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross);
layoutWrapper.setVisibility(View.GONE);
layoutWrapper.setBackground(null);
layoutWrapper.setAlpha(0.25f);
layout.setBackgroundColor(convertView.getResources()
.getColor(R.color.picto_default_background));
redCrossImage.setVisibility(View.GONE);
pictoImage.setScaleX(1.0f);
pictoImage.setScaleY(1.0f);
pictoImage.setVisibility(View.GONE);
if (picto == null) {
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
layoutWrapper.setVisibility(View.VISIBLE);
layoutWrapper.setBackground(convertView.getResources()
.getDrawable(R.drawable.picto_grid_item_border));
}
} else {
if (!picto.is_invisible()) {
layoutWrapper.setAlpha(1.00f);
}
try {
pictoImage.setImageBitmap(picto.get_bitmap(PCBcontext.getContext()));
if (!picto.is_invisible() || PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
layoutWrapper.setVisibility(View.VISIBLE);
pictoImage.setVisibility(View.VISIBLE);
layoutWrapper.setBackground(convertView.getResources()
.getDrawable(R.drawable.picto_grid_item_border));
if (picto.is_magnify()) {
pictoImage.setScaleX(1.2f);
pictoImage.setScaleY(1.2f);
}
if (picto.is_disabled()) {
redCrossImage.setVisibility(View.VISIBLE);
}
if (picto.is_category()) {
layout.setBackgroundColor(picto.get_color());
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
return convertView;
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.speech.tts.TextToSpeech;
import android.speech.tts.UtteranceProgressListener;
import android.text.InputType;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.DragEvent;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.yottacode.pictogram.action.PictosAction;
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.grammar.iLocalPicto;
import com.yottacode.pictogram.grammar.iVocabularyListener;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
public class PictogramActivity extends Activity implements iVocabularyListener, TextToSpeech.OnInitListener {
public static final String PREFS_NAME = "MyPrefsFile";
// Main layout for this activity
RelativeLayout mainLayout;
// Adapter for de grid showing the categories grid (and main pictos)
PictoGridAdapter pictoMainGridAdapter;
// Grid showing the categories grid (and main pictos)
GridView pictoMainGridView;
// Adapter for the grid showing pictos from a category (initially hidden)
PictoGridAdapter pictoCategoryGridAdapter;
// Grid showing pictos from a category (initially hidden)
GridView pictoCategoryGridView;
// Adapter for the tape view (list of pictos to send to the server)
TapeAdapter tapeAdapter;
// Tape view (list of pictos to send to the server)
GridView tapeGridView;
// Current picto category, if not null the corresponding category grid will be shown
Picto currentCategory;
// Object used for reading text
TextToSpeech tts;
// Element used for loading new pictos (while changing categories)
Vocabulary vocabulary;
// TODO describe this variable
static final int SELECT_PICTURE = 1;
// For disabling volume button (See method at the end of the class)
private final List blockedKeys = new ArrayList(Arrays.asList(KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_UP));
// String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
// Count for delete long press (hidden exit)
private int count_deletelong = 0;
// Animation for hidding the picto category view
Animation hidePictoMainViewAnimation;
// Animation for showing the picto category view
Animation showPictoMainViewAnimation;
// Button used for showing the picto category view
ImageButton showPictoCategoriesViewButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_pictogram);
this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout);
this.currentCategory = null;
this.count_deletelong = 0;
if (!PCBcontext.is_user_logged()) {
Log.i(LOG_TAG,"No user logged. Restarting app");
PCBcontext.getNetService().restart_app();
return;
}
this.vocabulary = PCBcontext.getVocabulary();
this.vocabulary.listen(PCBcontext.getRoom(), this);
this.vocabulary.setImgDownloaderListener(new iImgDownloaderListener() {
@Override
public void loadComplete() {
PictogramActivity.this.refresh();
}
@Override
public void loadImg(Img image) {
}
@Override
public void error(Exception err) {
}
});
if (this.vocabulary != null && this.vocabulary.size() > 0) {
Log.d(LOG_TAG, "Vocabulario correcto de tam:" + vocabulary.size());
}
this.tapeAdapter = new TapeAdapter();
this.tapeGridView = (GridView) this.findViewById(R.id.tape_grid_view);
this.tapeGridView.setAdapter(this.tapeAdapter);
this.pictoMainGridAdapter = new PictoGridAdapter(new LinkedList<Picto>());
this.pictoMainGridView = (GridView) this.findViewById(R.id.picto_main_grid_view);
this.pictoMainGridView.setAdapter(this.pictoMainGridAdapter);
this.pictoCategoryGridAdapter = new PictoGridAdapter(new LinkedList<Picto>());
this.pictoCategoryGridView = (GridView) this.findViewById(R.id.picto_category_grid_view);
this.pictoCategoryGridView.setAdapter(this.pictoCategoryGridAdapter);
// @TODO take this value from user configuration (0: normal, 1: large)
int pictogramSize = 0;
if (pictogramSize == 0) {
this.pictoMainGridView.setNumColumns(10);
this.pictoCategoryGridView.setNumColumns(10);
} else if (pictogramSize == 1) {
this.pictoMainGridView.setNumColumns(4);
this.pictoCategoryGridView.setNumColumns(4);
}
// tts = new TextToSpeech(this, this, "IVONA Text-to-Speech HQ");
tts = new TextToSpeech(this, this);
tts.setOnUtteranceProgressListener(new OnTTSEndListener());
this.tapeGridView.setOnDragListener(new OnPictoDragListener());
this.pictoMainGridView.setOnDragListener(new OnPictoDragListener());
this.pictoCategoryGridView.setOnDragListener(new OnPictoDragListener());
this.pictoMainGridView.setOnItemClickListener(new OnPictoClickListener());
this.pictoCategoryGridView.setOnItemClickListener(new OnPictoClickListener());
this.pictoMainGridView.setOnItemLongClickListener(new OnPictoLongClickListener());
this.pictoCategoryGridView.setOnItemLongClickListener(new OnPictoLongClickListener());
final ImageButton deleteButton = (ImageButton) findViewById(R.id.button_delete);
final ImageButton ttsButton = (ImageButton) findViewById(R.id.button_tts);
ttsButton.setOnClickListener(new OnTTSButtonClickListener());
deleteButton.setOnClickListener(new OnDeleteButtonClickListener());
deleteButton.setOnLongClickListener(new OnDeleteButtonLongClickListener());
this.showPictoCategoriesViewButton = (ImageButton) this.findViewById(R.id.showPictoCategoriesViewButton);
this.showPictoCategoriesViewButton.setOnClickListener(new OnShowPictoCategoriesViewButtonClick());
this.generateAnimations();
if (this.currentCategory != null) {
this.hidePictoMainGridView();
} else {
this.showPictoMainGridView();
}
}
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
tts.setLanguage(Locale.getDefault());
}
}
@Override
protected void onStop() {
super.onStop();
Log.i(LOG_TAG,"Closing app");
PCBcontext.getNetService().closeNotifyStatus();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (tts != null){
tts.shutdown();
}
}
/**
* Creates the animations for moving the picto view
*/
private void generateAnimations() {
DisplayMetrics displayMetrics = new DisplayMetrics();
this.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int animationDuration = 400;
int animationWidth = displayMetrics.widthPixels;
this.hidePictoMainViewAnimation = new TranslateAnimation(0, -animationWidth, 0, 0);
this.hidePictoMainViewAnimation.setDuration(animationDuration);
this.hidePictoMainViewAnimation.setFillAfter(true);
this.hidePictoMainViewAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
this.hidePictoMainViewAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) {
pictoMainGridView.setTranslationZ(-1000.0f);
pictoMainGridView.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animation animation) {}
});
this.showPictoMainViewAnimation = new TranslateAnimation(-animationWidth, 0, 0, 0);
this.showPictoMainViewAnimation.setDuration(animationDuration);
this.showPictoMainViewAnimation.setFillAfter(true);
this.showPictoMainViewAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
this.showPictoMainViewAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
pictoMainGridView.setTranslationZ(1000.0f);
pictoMainGridView.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {}
@Override
public void onAnimationRepeat(Animation animation) {}
});
}
/**
* Show the main category grid view and hide the pictoGrid, unloading all pictos
* if necesary.
*/
private void showPictoMainGridView() {
Log.d(LOG_TAG, "Showing pictoMainGridView");
this.pictoMainGridAdapter.clear();
this.pictoMainGridAdapter.addAll(this.sort(this.vocabulary.startSentence()));
this.pictoMainGridAdapter.notifyDataSetChanged();
this.pictoMainGridView.setEnabled(true);
this.pictoCategoryGridView.setEnabled(false);
if (this.pictoMainGridView.getAnimation() == this.hidePictoMainViewAnimation) {
this.pictoMainGridView.startAnimation(this.showPictoMainViewAnimation);
}
this.currentCategory = null;
}
/**
* Hides the main category grid view and show a concrete category (this.currentCategory)
*/
private void hidePictoMainGridView() {
Log.d(LOG_TAG, "Hiding pictoMainGridView");
this.pictoCategoryGridAdapter.clear();
this.pictoCategoryGridAdapter.addAll(this.sort(this.vocabulary.next(this.currentCategory)));
this.pictoCategoryGridAdapter.notifyDataSetChanged();
if (this.currentCategory.get_color() != -1) {
this.pictoCategoryGridView.setBackgroundColor(this.currentCategory.get_color());
}
this.pictoMainGridView.setEnabled(false);
this.pictoCategoryGridView.setEnabled(true);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.pictoMainGridView.startAnimation(this.hidePictoMainViewAnimation);
}
}
/**
* Returns pictoCategoryGridAdapter or pictoMainGridAdapter depending on the current View
*/
private PictoGridAdapter getCurrentPictoGridAdapter() {
return (currentCategory == null) ? this.pictoMainGridAdapter : this.pictoCategoryGridAdapter;
}
/**
* Order a linked list of pictos with "blank spaces" between them
* @param list
* @return
*/
public LinkedList<Picto> sort(LinkedList<Picto> list){
if (list == null) {
list = new LinkedList<>();
}
LinkedList<Picto> ll = new LinkedList<>();
// This is to show the pictos ordered in the 2D Array that represents the panel
int rows = getResources().getInteger(R.integer.rows);
int cols = getResources().getInteger(R.integer.columns);
Picto[][] mp = new Picto[rows][cols];
for (Picto p : list) {
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
if (p.get_column() != -1 && p.get_row() != -1) {
mp[p.get_column()][p.get_row()] = p;
}
} else {
if (p.getFreeColumn() != -1 && p.getFreeRow() != -1) {
mp[p.getFreeColumn()][p.getFreeRow()] = p;
}
}
}
try {
/*
Picto blankPicto = new Picto(0,
"/symbolstx/color/png/arts_crafts/eraser.png", // TODO Definir imagen para picto en blanco
"Blank picto",
"{\"magnify\":false,\"highlight\":false,\"coord_y\":1,\"id_cat\":12303,\"status\":\"invisible\",\"coord_x\":4}");
*/
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++){
if(mp[i][j] != null) ll.add(mp[i][j]);
else ll.add(null); // Add the "blank picto" simulating an empty position
}
}
}
catch (Exception e) {
e.printStackTrace();
}
return ll;
}
/**
* Background task that updates the ui into the main thread
*/
public void refresh() {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (currentCategory != null) {
hidePictoMainGridView();
} else {
showPictoMainGridView();
}
}
});
}
/**
* @TODO check documentation
* De la interfaz iVocabularyListener
*/
@Override
public void change(action action, int picto_cat, int picto_id, JSONObject args) {
Log.i(LOG_TAG, "Vocabulary action listened: " + action);
if(args!=null) Log.d(LOG_TAG, "args: " + args.toString());
refresh();
}
/**
* Disable Back Button --> Kiosk mode
*/
@Override
public void onBackPressed() {
// Inflate the layout for the AlertDialog
View dialogEscape = View.inflate(this, R.layout.dialog_escape, null);
final CheckBox checkBox = (CheckBox) dialogEscape.findViewById(R.id.checkBox);
final EditText input = (EditText) dialogEscape.findViewById(R.id.editText);
// Build de AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString(R.string.exitPictogram));
builder.setView(dialogEscape);
// Set up the buttons
builder.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String m_Text = input.getText().toString();
String keyword = PCBcontext.getDevice().getKeyword();
if (m_Text.equalsIgnoreCase(keyword)) {
// Change the password
if(checkBox.isChecked()){
// Show a new dialog
View dialogChangeEscapeCode = View.inflate(PCBcontext.getContext(), R.layout.dialog_change_escape_code, null);
final EditText input1 = (EditText) dialogChangeEscapeCode.findViewById(R.id.editText1);
final EditText input2 = (EditText) dialogChangeEscapeCode.findViewById(R.id.editText2);
// Build the AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(PCBcontext.getContext());
builder.setTitle(PCBcontext.getContext().getResources().getString(R.string.newEscapeCode));
builder.setView(dialogChangeEscapeCode);
// Set up the buttons
builder.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Retrieve the text of the 2 password inputs
String m_Text1 = input1.getText().toString();
String m_Text2 = input2.getText().toString();
// If they are equal
if (m_Text1.equalsIgnoreCase(m_Text2)) {
// Change the keyword
PCBcontext.getDevice().setKeyword(m_Text1);
Toast.makeText(PCBcontext.getContext(), getResources().getString(R.string.codeModified), Toast.LENGTH_SHORT).show();
// And exit PictogramActivity
finish();
} else Toast.makeText(PCBcontext.getContext(), getResources().getString(R.string.codesNotEqual), Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}else {
// Finish this Activity it the code is ok and is not checked the checkbox to change the code
finish();
/*
// Start the main activity
Intent mainActivity = new Intent(context, MainActivity.class);
startActivity(mainActivity);
*/
}
// Wrong code
} else Toast.makeText(PCBcontext.getContext(),getResources().getString(R.string.wrongCode), Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}
/**
* Disable long power button press (system menu)
* @param hasFocus
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if(!hasFocus) {
// Close every kind of system dialog
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}
/**
* Disable volume button on key event
* @param event
*/
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (blockedKeys.contains(event.getKeyCode())) {
return true;
} else {
return super.dispatchKeyEvent(event);
}
}
/* *********************************************************************************************
* Event listener classes
* ********************************************************************************************/
/**
* Class used for dragging pictos to the tape
*/
private class OnPictoDragListener implements View.OnDragListener {
//Drawable normalShape = getResources().getDrawable(R.drawable.normal_shape);
//Drawable targetShape = getResources().getDrawable(R.drawable.target_shape);
@Override
public boolean onDrag(View v, DragEvent event) {
// Handles each of the expected events
switch (event.getAction()) {
//signal for the start of a drag and drop operation.
case DragEvent.ACTION_DRAG_STARTED:
// do nothing
Log.d("Drag:", "1 Drag started");
break;
//the drag point has entered the bounding box of the View
case DragEvent.ACTION_DRAG_ENTERED:
//v.setBackground(targetShape); //change the shape of the view
Log.d("Drag:", "2 Drag entered");
break;
//the user has moved the drag shadow outside the bounding box of the View
case DragEvent.ACTION_DRAG_EXITED:
//v.setBackground(normalShape); //change the shape of the view back to normal
Log.d("Drag:", "3 Drag exited");
break;
//drag shadow has been released,the drag point is within the bounding box of the View
case DragEvent.ACTION_DROP:
Log.d("Drag:", "4 Drop");
View view = (View) event.getLocalState();
ViewGroup viewgroup = (ViewGroup) view.getParent();
int position = Integer.parseInt((String) event.getClipDescription().getLabel());
// if the view is the tape_grid_view, we accept the drag item
// Destino tape_grid_view y origen panel_grid_view
if(v == findViewById(R.id.tape_grid_view) && viewgroup == findViewById(R.id.picto_category_grid_view)) {
Log.d("Drag:", "Posición: " + position);
Picto p = pictoCategoryGridAdapter.getItem(position);
if(!p.is_category()) {
currentCategory = null;
tapeAdapter.addItem(p);
tapeAdapter.notifyDataSetChanged();
showPictoMainGridView();
PCBcontext.getActionLog().log(new TalkAction(TalkAction.ADD, p));
}
}
// Si el destino es el panel y el origen la cinta de frase
else if(v == findViewById(R.id.picto_category_grid_view) && viewgroup == findViewById(R.id.tape_grid_view)){
Log.d("Drag:", "Posición: " + position);
Picto p = tapeAdapter.getItem(position);
tapeAdapter.deleteItem(position);
tapeAdapter.notifyDataSetChanged();
}
break;
//the drag and drop operation has concluded.
case DragEvent.ACTION_DRAG_ENDED:
Log.d("Drag:", "5 Drag ended");
// v.setBackground(normalShape); //go back to normal shape
default:
break;
}
return true;
}
}
/**
* Class used for picto clicking feedback
*/
private class OnPictoClickListener implements AdapterView.OnItemClickListener{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p != null && !p.is_invisible() && p.is_enabled()) {
Log.d(LOG_TAG, "Clic en picto: " + p.toString());
//Log.d(LOG_TAG, "STATUS: " + p.get_status());
//QUITAR PARA QUE HABLE pictoCategoryGridAdapter.ttsPicto(p, tts);
// If is not the blank picto, it isn't invisible or disabled
if (p.get_id() != 0 &&
!p.get_status().equalsIgnoreCase("invisible") &&
!p.get_status().equalsIgnoreCase("disabled")) {
LinkedList<Picto> ll = sort(PCBcontext.getVocabulary().next(p));
//LinkedList<Picto> ll = vocabulary.next(p);
Log.d(LOG_TAG, "Lista de pictos recuperada: " + ll.toString());
int maxInTape = getResources().getInteger(R.integer.maxInTape);
// If the picto is a category
if (p.is_category()) {
currentCategory = p;
PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p));
hidePictoMainGridView();
} else if (tapeAdapter.getCount() < maxInTape) {
currentCategory = null;
tapeAdapter.addItem(p);
tapeAdapter.notifyDataSetChanged();
PCBcontext.getActionLog().log(new TalkAction(TalkAction.ADD, p));
showPictoMainGridView();
}
}
}
}
}
/**
* Class used for long pressing on pictos (start drag)
*/
private class OnPictoLongClickListener implements AdapterView.OnItemLongClickListener {
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
// Si es supervisor al hacer longClick deshabilito ese pictograma o lo habilito
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p == null) {
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
Log.d(LOG_TAG, "No tengo pictograma. Abro carrete...");
int cols = getResources().getInteger(R.integer.columns);
addPicto(position % cols, (int) (position / cols));
}
else
Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
} else {
p.alter_status();
getCurrentPictoGridAdapter().notifyDataSetChanged();
}
} else {
ClipData.Item item = new ClipData.Item("" + position);
String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN};
ClipData data = new ClipData("" + position, mimeTypes, item);
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p != null && !p.is_invisible() && p.is_enabled()) {
// If is not the blank picto, it isn't invisible or disabled
if (p.get_id() != 0 &&
!p.get_status().equalsIgnoreCase("invisible") &&
!p.get_status().equalsIgnoreCase("disabled") &&
tapeAdapter.getCount() < 8) {
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(data, //data to be dragged
shadowBuilder, //drag shadow
view, //local data about the drag and drop operation
0 //no needed flags
);
//view.setVisibility(View.INVISIBLE);
}
}
}
return true;
}
}
/**
* Class used for reading pictos on TTS button click
*/
private class OnTTSButtonClickListener implements View.OnClickListener {
@Override
public void onClick(View arg0) {
LinkedList<Picto> lp = tapeAdapter.getAll();
// This triggers the "Show" websocket action
PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts);
}
}
/**
* Class for listening the TTS start/end/error events.
* It clears the tape and shows the category grid when the speech has finished or errored.
*/
private class OnTTSEndListener extends UtteranceProgressListener {
@Override
public void onStart(String utteranceId) {
Log.d(LOG_TAG, "TTS tape read start");
}
@Override
public void onDone(String utteranceId) {
Log.d(LOG_TAG, "TTS tape read end");
this.finishSpeech();
}
@Override
public void onError(String utteranceId) {
Log.d(LOG_TAG, "TTS tape read error");
this.finishSpeech();
}
private void finishSpeech() {
runOnUiThread(new Runnable() {
@Override
public void run() {
tapeAdapter.deleteAll();
tapeAdapter.notifyDataSetChanged();
showPictoMainGridView();
}
});
}
}
/**
* Class used for canceling a list of pictos on the tape
*/
private class OnDeleteButtonClickListener implements View.OnClickListener {
@Override
public void onClick(View arg0) {
if (tapeAdapter.hasElements()) {
Picto p = tapeAdapter.getLastItem();
// Call to static log method
PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, p));
// Send websocket action
tapeAdapter.deleteLastView();
tapeAdapter.notifyDataSetChanged();
}
}
}
/**
* Class used for long click on delete button. When a press count reaches 3, the application
* exists.
*/
private class OnDeleteButtonLongClickListener implements View.OnLongClickListener {
@Override
public boolean onLongClick(View v) {
count_deletelong++;
if (count_deletelong >= 3) {
//TODO: COMPROBAR SI LOS USUARIOS QUE BUSCO EXISTEN: SI NO PONER LOS DATOS POR DEFECTO*******************************************************************/
//Cojo los id del ultimo estudiante y el ultimo supervisor
int lastIdStu = PCBcontext.getDevice().getLastStuId();
User actual = PCBcontext.getPcbdb().getCurrentUser();
User usuario_anterior;
String lastUserName = null;
String lastPassword= null;
if (actual.is_supervisor()) //Si el que habia es supervisor busco el ultimo niño
try {
usuario_anterior = PCBcontext.getDevice().findUser(lastIdStu,User.NO_SUPERVISOR);
if(usuario_anterior!=null){
lastUserName = usuario_anterior.get_nickname_stu();
lastPassword = usuario_anterior.get_pwd_stu();
}
} catch (JSONException e) {
e.printStackTrace();
}
else {
int lastIdSup = PCBcontext.getDevice().getLastSupId();
try {
usuario_anterior = PCBcontext.getDevice().findUser(lastIdStu,lastIdSup);
if(usuario_anterior!=null){
lastUserName = usuario_anterior.get_email_sup();
lastPassword = usuario_anterior.get_pwd_sup();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
Class serialClass;
try {
serialClass=Class.forName(getString(R.string.SerialClass));
} catch (ClassNotFoundException e) {
Log.e(this.getClass().getCanonicalName(),"S:"+getString(R.string.SerialClass));
serialClass=SerialActivity.class;
}
Intent serialActivity = new Intent(getBaseContext(), serialClass);
if (lastUserName!=null) {
Log.i(this.getClass().getCanonicalName(), "Switch user to "+ lastUserName);
serialActivity.putExtra("switch_usr", lastUserName);
serialActivity.putExtra("switch_pwd", lastPassword);
}
PictogramActivity.this.finish();
PCBcontext.getNetService().restart_app(serialActivity);
}
return false;
}
}
/**
* Listener used for bringing back the picto categories grid when clicked.
*/
private class OnShowPictoCategoriesViewButtonClick implements View.OnClickListener {
@Override
public void onClick(View v) {
showPictoMainGridView();
}
}
/* *********************************************************************************************
* Methods for adding a new picto from pcb
* ********************************************************************************************/
/**
* add a local picto from pcb
* @param row
* @param col
*/
public void addPicto(int row, int col) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
this.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
this.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else {
this.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
this.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
}
startActivityForResult(intent, SELECT_PICTURE);
}
/**
* función para la edición de un texto asociado a una nueva imagen y guardar el nuevo picto
*/
public void chooseTextAndSavePicto(final String selectedImagePath, final int row, final int col, final int freeRow, final int freeColumn) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString(R.string.enterImgLabel));
// Set up the input
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input);
// Set up the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int cat = PictogramActivity.this.currentCategory != null
? PictogramActivity.this.currentCategory.get_id()
: Picto.NO_CATEGORY;
PCBcontext.getVocabulary().saveLocalPicto(
selectedImagePath,
input.getText().toString(),
cat,
row,
col,
freeRow,
freeColumn,
new iLocalPicto() {
@Override
public void saved(Picto localPicto) {
PictogramActivity.this.refresh();
try {
new PictoUploader(localPicto).upload(PictogramActivity.this);
} catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
}
}
});
}
});
builder.show();
}
/**
* Función para la selección de una foto del carrete
* @param requestCode
* @param resultCode
* @param data
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
if (requestCode == SELECT_PICTURE) {
String selectedImagePath;
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
int row=this.getIntent().getIntExtra(Picto.JSON_ATTTRS.ROW, -1);
int col=this.getIntent().getIntExtra(Picto.JSON_ATTTRS.COLUMN, -1);
int freeRow = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_ROW, -1);
int freeColumn = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
Log.i(this.getClass().getCanonicalName(), "0 Picto x y " + " " + row + " " + col);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.ROW);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.COLUMN);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_ROW);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_COLUMN);
chooseTextAndSavePicto(selectedImagePath, row, col, freeRow, freeColumn);
}
}
}
/**
* Función para la selección de una foto del carrete
* @param uri
* @return
*/
static public String getPath(Uri uri) {
if( uri == null ) {
return null;
}
// this will only work for images selected from gallery
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = PCBcontext.getContext().getContentResolver().query(uri, projection, null, null, null);
if( cursor != null ){
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
return uri.getPath();
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R;
/**
* A login screen that offers login via email/password.
*/
public class SerialActivity extends Activity {
public static final String PREFS_NAME = "MyPrefsFile";
// String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
protected boolean is_legal_user(String user_name, Activity activity) {return true;}
/**
* Return the default user+pwd when login.The policy is
* 1. switch user
* 2. last user
* @return user+pwd to be used
*/
private String[] loginUserPolicy() {
Intent intent=getIntent();
String username = intent.getStringExtra("switch_usr");
String password = intent.getStringExtra("switch_pwd");
if (username==null) {
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
username = settings.getString("username", "");
password = settings.getString("password", "");
}
return new String[]{username,password};
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_serial);
final EditText mSerialViewMail = (EditText) findViewById(R.id.serialmail);
final EditText mSerialViewPass = (EditText) findViewById(R.id.serialpass);
String default_user[]=loginUserPolicy();
String username=default_user[0];
String password=default_user[1];
// Escribo el último valor indicado de username
mSerialViewMail.setText(username);
mSerialViewPass.setText(password);
// Escribo el último valor indicado de username
mSerialViewMail.setText(username);
if (!username.equals("") && !password.equals("") && !getIntent().getBooleanExtra("resetPrevUser", true)) new UserLogin().login(username, password,SerialActivity.this, PictogramActivity.class, LoginActivity.class);
Button mEntrarButton = (Button) findViewById(R.id.entrar_button);
mEntrarButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String username = mSerialViewMail.getText().toString();
if (is_legal_user(username,SerialActivity.this)) {
String password = mSerialViewPass.getText().toString();
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("username", username);
editor.putString("password", password);
editor.commit();
if (!username.equals("") && !password.equals(""))
new UserLogin().login(username, password, SerialActivity.this, PictogramActivity.class, LoginActivity.class);
}
}
});
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import com.yottacode.pictogram.tabletlibrary.R;
import java.util.Timer;
import java.util.TimerTask;
public class SplashScreenActivity extends Activity {
// Set the duration of the splash screen
private static final long SPLASH_SCREEN_DELAY = 3000;
protected Class MainActivityClass() {return MainActivity.class;}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set landscape orientation
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// Hide title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_splash_screen);
TimerTask task = new TimerTask() {
@Override
public void run() {
// Start the next activity
Intent mainIntent = new Intent().setClass(
SplashScreenActivity.this, SplashScreenActivity.this.MainActivityClass());
startActivity(mainIntent);
// Intent pictogramActivity = new Intent().setClass(
// SplashScreenActivity.this, PictogramActivity.class);
//pictogramActivity.putExtra();
// seguir: hay que pasarle el estudiante y el supervisor, para cargar la colección, etc...
// startActivity(pictogramActivity);
// Close the activity so the user won't able to go back this
// activity pressing Back button
finish();
}
};
// Simulate a long loading process on application startup.
Timer timer = new Timer();
timer.schedule(task, SPLASH_SCREEN_DELAY);
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Fragment;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
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.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.Vector;
/**
* StudentFragmentGrid implements the gridview with the students
* @author Miguel Ángel García Cumbreras
* @author Fernando
* @version 1.1
*/
public class StudentFragmentGrid extends Fragment{
final String TAG_ID = "id";
final String TAG_USERNAME = "username";
final String TAG_NAME = "name";
final String TAG_SURNAME = "surname";
final String TAG_GENDER = "gender";
final String TAG_PIC = "pic";
final String TAG_LANG = "lang";
final String TAG_ATTRIBUTES = "attributes";
final String TAG_SUPERVISION="supervision";
Vector<Integer> idStudents;
String nameStudents[];
Vector<Bitmap> imageStudents;
private Vector<JSONObject> downloaded_students;
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
GridView gridView;
boolean onlineStudentsOK=false;
private void showStudentsGrid(){
CustomList adapter = new CustomList(getActivity(), nameStudents, imageStudents);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
set_user(pos);
}
});
}
private void set_user(int i) {
Boolean offline = getActivity().getIntent().getBooleanExtra("offline", false);
if (offline) {
User currentUser= null;
try {
currentUser = PCBcontext.getDevice().findUser(idStudents.get(i),getActivity().getIntent().getIntExtra("sup_id", 0));
} catch (JSONException e) {
e.printStackTrace();
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage());
}
PCBcontext.set_user(currentUser, null, null);
Intent pictogramActivity = new Intent(getActivity(), PictogramActivity.class);
startActivity(pictogramActivity);
} else
new_user(i);
}
private void new_user(int i) {
JSONObject st = this.downloaded_students.get(i);
Intent intent = getActivity().getIntent();
try {
User new_user = new User(
st.getInt(TAG_ID),
st.getString(TAG_USERNAME),
null,
st.getString(TAG_NAME),
st.getString(TAG_SURNAME),
st.getString(TAG_PIC),
st.getString(TAG_GENDER),
st.getString(TAG_LANG),
st.getString(TAG_ATTRIBUTES),
intent.getIntExtra("sup_id", 0),
intent.getStringExtra("email"),
intent.getStringExtra("password"),
intent.getStringExtra("name"),
intent.getStringExtra("surname"),
intent.getStringExtra("pic"),
intent.getStringExtra("gender"),
intent.getStringExtra("lang"),
"");
PCBcontext.getDevice().insertUser(new_user);
Log.i(this.getClass().getCanonicalName(),"Loading vocabulary for "+new_user.get_name_stu());
final ProgressDialog progressDialog=ProgressDialog.show(getActivity(), getString(R.string.loadingGrammar),
getString(R.string.userLoadingTxt), false, false);
PCBcontext.set_user(new_user, intent.getStringExtra("token"), new iImgDownloaderListener() {
@Override
public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss();
Intent pictogramActivity = new Intent(getActivity(), PictogramActivity.class);
startActivity(pictogramActivity);
}
@Override
public void loadImg(Img image) {
}
public void error(Exception e) {
if (progressDialog.isShowing()) progressDialog.dismiss();
GUITools.show_alert(StudentFragmentGrid.this.getActivity(), R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "Server error:"+ e.getLocalizedMessage());
}
});
} catch (JSONException e) {
e.printStackTrace();
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage());
}
}
private void show_student_list_online() {
final Vector<Img> imgs = new Vector<>(downloaded_students.size());
this.nameStudents=new String[downloaded_students.size()];
this.idStudents=new Vector<>(downloaded_students.size());
this.imageStudents=new Vector<>(downloaded_students.size());
for (int i = 0; i < downloaded_students.size(); i++) {
JSONObject st;
try {
st = downloaded_students.get(i);
Integer st_id = st.getInt(TAG_ID);
String st_name = st.getString(TAG_NAME);
String st_pic = st.getString(TAG_PIC);
nameStudents[i]=st_name;
idStudents.add(st_id);
imgs.add(new Img(st_id,st_pic,Img.STUDENT)); //it's required to download student's images
} catch (JSONException e) {
e.printStackTrace();
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage());
}
} //for
final ProgressDialog progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg),
getString(R.string.userLoadingTxt), false, false);
ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() {
@Override
public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss();
if (downloaded_students.size() > 1) {
for (int i = 0; i < imgs.size(); i++)
try {
imageStudents.add(imgs.get(i).get_bitmap(getActivity().getBaseContext()));
} catch (IOException e) {
e.printStackTrace();
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(),e.getMessage());
}
}
if (StudentFragmentGrid.super.getView()!=null)
showStudentsGrid();
else
onlineStudentsOK=true;
}
@Override
public void loadImg(Img image) {
}
public void error(Exception e) {
if (progressDialog.isShowing()) progressDialog.dismiss();
GUITools.show_alert(PCBcontext.getContext(), R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "Server error:"+ e.getLocalizedMessage());
}
}, ImgDownloader.tsource.remote);
downloader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, imgs);
}
private void download_students(int sup_id ) {
String token = getActivity().getIntent().getExtras().getString("token");
RestapiWrapper wrapper = new RestapiWrapper(
getActivity().getApplicationContext().getResources().getString(R.string.server), token);
String operation = "sup/" + sup_id + "/students";
final ProgressDialog progressDialog= ProgressDialog.show(getActivity(), getString(R.string.userLoadingTxt),
getString(R.string.userLoadingTxt), false, false);
wrapper.ask(operation, new iRestapiListener() {
@Override
public void error(Exception e) {
Log.e(this.getClass().getName(), " Server restapi error: " + e.getLocalizedMessage());
if (progressDialog.isShowing()) progressDialog.dismiss();
GUITools.show_alert(getActivity(), R.string.loginErrorTxt, getString(R.string.serverError), new GUITools.iOKListener() {
@Override
public void ok() {
PCBcontext.getNetService().restart_app();
}
});
}
@Override
public void preExecute() {
}
@Override
public void result(JSONArray students) {
if (progressDialog.isShowing()) progressDialog.dismiss();
StudentFragmentGrid.this.downloaded_students=new Vector();
for (int i=0;i<students.length();i++) {
JSONObject student;
try {
student = students.getJSONObject(i);
if (student.getInt(TAG_SUPERVISION)>0)
StudentFragmentGrid.this.downloaded_students.add(student);
} catch (JSONException e) {
e.printStackTrace();
}
}
switch (students.length()) {
case 0:
GUITools.show_alert(getActivity(), R.string.loginErrorTxt,getString(R.string.noStudentsError), new GUITools.iOKListener() {
@Override
public void ok() {
PCBcontext.getNetService().restart_app();
}
});
break;
case 1:
new_user(0);
break;
default:
show_student_list_online();
}
}
@Override
public void result(JSONObject result) {
}
});
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
}
@Override
public void onStart() {
super.onStart();
Intent intent=getActivity().getIntent();
Boolean offline = intent.getBooleanExtra("offline", false);
int sup_id=intent.getIntExtra("sup_id", 0);
if (offline) {
Vector<User> users;
try {
users = PCBcontext.getDevice().recoverStudents(sup_id);
Log.i(this.getClass().getCanonicalName(),"Recovering "+users.size()+" students list for "+ sup_id+" from local DB");
} catch (JSONException e) {
e.printStackTrace();
users=null;
}
int i=0;
this.nameStudents=new String[users.size()];
this.idStudents=new Vector<>(users.size());
this.imageStudents=new Vector<>(users.size());
for (User user: users) {
this.idStudents.add(user.get_id_stu());
this.nameStudents[i++]=user.get_name_stu();
try {
this.imageStudents.add(user.get_bitmap_stu(getActivity().getBaseContext()));
} catch (IOException e) {
e.printStackTrace();
Log.e(this.getClass().getName(), " Getting images error: " + e.getLocalizedMessage());
}
}
}
else
download_students(sup_id);
if (offline || onlineStudentsOK) showStudentsGrid();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_new_student, container, false);
gridView = (GridView) view.findViewById(R.id.loginStudentGridView);
return view;
}
}
package com.yottacode.pictogram.tabletlibrary.gui;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.yottacode.pictogram.dao.Picto;
import java.util.Iterator;
import java.util.LinkedList;
public class TapeAdapter extends BaseAdapter {
//private Context mContext;
private LinkedList<Picto> pictoLinkedList;
public TapeAdapter(){
//mContext = c;
pictoLinkedList = new LinkedList<Picto>(); // the list begins empty
}
@Override
public int getCount(){
return pictoLinkedList.size();
}
public Picto getItem(int position) {
// este método debería devolver el objeto que esta en esa posición del
// adapter.
return pictoLinkedList.get(position);
}
public long getItemId(int position) {
// este método debería devolver el id de fila del item que esta en esa
// posición del adapter. No es necesario en este caso más que devolver 0.
return 0;
}
// AÑADIR ITEM AL ADAPTADOR
public void addItem(Picto p){
pictoLinkedList.add(p);
}
// ELIMINAR ITEM DEL ADAPTADOR
public void deleteItem(int position){
pictoLinkedList.remove(position);
}
// ELIMINAR el último ITEM DEL ADAPTADOR
public void deleteLastView(){
// Controlar excepcion al intentar eliminar el último cuando no hay elementos
try{
pictoLinkedList.removeLast();
}catch(ArrayIndexOutOfBoundsException exception){
Log.e("Excepción", "ArrayIndexOutOfBounds: " + exception.getMessage());
}
}
// ELIMINAR TODOS LOS ITEMS DEL ADAPTADOR
public void deleteAll(){
pictoLinkedList.clear();
}
// DEVUELVE TODOS LOS ELEMENTOS
public LinkedList<Picto> getAll(){ return pictoLinkedList; }
// Devuelvo la cadena actual como un String
public String getAllAsString(){
String complete = "";
Iterator<Picto> iterator = pictoLinkedList.iterator();
while (iterator.hasNext()) {
Picto current = iterator.next();
complete += " " + current.get_translation();
}
return complete;
}
// DEVUELVE último elemento
public Picto getLastItem(){
return pictoLinkedList.getLast();
}
// Devuelve true o false si tiene o no elementos la lista de pictos
public boolean hasElements(){
return (pictoLinkedList.size() > 0);
}
@Override
public View getView(int position, View convertView, ViewGroup parent){
return PictoItemViewGenerator.getPictoView(
this.pictoLinkedList.get(position),
convertView,
parent
);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void ttsAllNew(TextToSpeech tts) {
String input = getAllAsString();
Bundle params = new Bundle();
params.putString(TextToSpeech.Engine.KEY_PARAM_VOLUME, "1");
params.putString(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "TAPE_READ");
tts.speak(input, TextToSpeech.QUEUE_FLUSH, params, "TAPE_READ");
}
}
package com.yottacode.pictogram.tabletlibrary.net;
import android.app.NotificationManager;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
import com.yottacode.pictogram.tools.PCBcontext;
/**
* Background notify service
* @author Fernando Martinez Santiago
* @version 1.0
*/
public class NetServiceTablet implements iNetServiceDevice {
private static NotificationCompat.Builder builder;
public void build() {
this.builder = new NotificationCompat.Builder(PCBcontext.getContext());
/* Intent resultIntent = new Intent(PCBcontext.getContext(), PictogramActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext());
stackBuilder.addParentStack(PictogramActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(resultPendingIntent);*/
}
public void notifyStatus(boolean updated) {
int notifyID = 1;
String user="";
if (PCBcontext.getPcbdb()!=null) {
user=PCBcontext.getPcbdb().getCurrentUser().get_name_stu()+" "+PCBcontext.getPcbdb().getCurrentUser().get_surname_stu();
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor())
user += " (" + PCBcontext.getPcbdb().getCurrentUser().get_name_sup() + ")";
}
if (updated)
builder.setSmallIcon(R.drawable.application_online)
.setContentTitle(PCBcontext.getContext().getResources().getString(R.string.pictogram_online))
.setContentText(user);
else
builder.setSmallIcon(R.drawable.application_offline)
.setContentTitle(PCBcontext.getContext().getResources().getString(R.string.pictogram_offline))
.setContentText(user);
NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
mNotificationManager.notify(notifyID, builder.build());
}
public void closeNotifyStatus(){
int notifyID = 1;
NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
mNotificationManager.cancel(notifyID);
}
/**
* if the user becomes from offline to online and the login is failed, then the user relogin in
* the app. The most frequent reason is a password change while the user have been logged
* offline
*/
public void restart_app(Intent serialActivity) {
Log.i(this.getClass().getCanonicalName(),"App restarting");
if (serialActivity==null) {
Class serialClass;
try {
serialClass=Class.forName(PCBcontext.getContext().getString(R.string.SerialClass));
} catch (ClassNotFoundException e) {
Log.e(this.getClass().getCanonicalName(),"S:"+PCBcontext.getContext().getString(R.string.SerialClass));
serialClass=SerialActivity.class;
}
serialActivity = new Intent(PCBcontext.getContext(), serialClass);
}
serialActivity.putExtra("resetPrevUser", true);
PCBcontext.getContext().startActivity(serialActivity);
}
public void restart_app() {restart_app(null);}
}
<resources>
<string name="app_name">com.yottacode.pictogram.Tablet</string>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":tabletlibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":tabletlibrary" />
</configuration>
</facet>
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<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/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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/typedefs.txt" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" exported="" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" 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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.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="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" 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="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="@dimen/picto_border_width" android:color="@color/picto_border" />
<corners android:radius="2dp" />
</shape>
\ No newline at end of file
...@@ -43,6 +43,13 @@ ...@@ -43,6 +43,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" />
...@@ -51,13 +58,6 @@ ...@@ -51,13 +58,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" />
...@@ -66,14 +66,6 @@ ...@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" />
...@@ -82,6 +74,14 @@ ...@@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
</facet> </facet>
<facet type="android" name="Android"> <facet type="android" name="Android">
<configuration> <configuration>
<option name="SELECTED_BUILD_VARIANT" value="CIFlavorDebug" /> <option name="SELECTED_BUILD_VARIANT" value="DevFlavorDebug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleCIFlavorDebug" /> <option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileCIFlavorDebugSources" /> <option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" />
<afterSyncTasks> <afterSyncTasks>
<task>generateCIFlavorDebugSources</task> <task>generateDevFlavorDebugSources</task>
</afterSyncTasks> </afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" /> <option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
...@@ -24,64 +24,64 @@ ...@@ -24,64 +24,64 @@
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/CIFlavor/debug" /> <output url="file://$MODULE_DIR$/build/intermediates/classes/DevFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/CIFlavor/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/CIFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/CIFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/CIFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/CIFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/CIFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/CIFlavor/debug" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/DevFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/CIFlavor/debug" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/DevFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/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/r/androidTest/DevFlavor/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/aidl/androidTest/DevFlavor/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/buildConfig/androidTest/DevFlavor/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/rs/androidTest/DevFlavor/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/source/apt/androidTest/DevFlavor/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/rs/androidTest/DevFlavor/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$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
...@@ -106,14 +106,6 @@ ...@@ -106,14 +106,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <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/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" 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/assets" type="java-test-resource" />
...@@ -122,6 +114,14 @@ ...@@ -122,6 +114,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" 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/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" 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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
......
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