From 384351b99c9d86f29354ccfebd21cf592c5c95ee Mon Sep 17 00:00:00 2001
From: "Vishnu Sanal. T" <50027064+VishnuSanal@users.noreply.github.com>
Date: Thu, 24 Jun 2021 20:14:19 +0530
Subject: [PATCH 1/9] Create pull_request_template.md (#9)
* Create pull_request_template.md
Create PR template
* Update pull_request_template.md
---
.github/pull_request_template.md | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 .github/pull_request_template.md
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..cb8c58a
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,24 @@
+# PR Info
+
+## Issue Details
+
+
+
+ - **Fixes** #----
+ - **Addresses** #----
+
+## Branch
+ - **Addresses** `development`
+
+## Type of change
+
+
+
+- **Bug Fix**
+- **New Feature**
+- **Breaking Change**
+- **Other**
+
+## Additional Info
+
+
From 0b5d271e03ed65c9717f9eb5dff1e889afd7658e Mon Sep 17 00:00:00 2001
From: Sushant <56603153+sushant-varanasi@users.noreply.github.com>
Date: Sat, 21 Aug 2021 17:20:42 +0530
Subject: [PATCH 2/9] Upgraded gradle version
---
.idea/compiler.xml | 18 +----------------
.idea/gradle.xml | 2 ++
.idea/jarRepositories.xml | 25 ++++++++++++++++++++++++
.idea/misc.xml | 25 +++++++++++++++++++++---
.idea/modules.xml | 9 ---------
.idea/runConfigurations.xml | 1 +
app/build.gradle | 4 ++--
build.gradle | 2 +-
gradle/wrapper/gradle-wrapper.properties | 3 +--
9 files changed, 55 insertions(+), 34 deletions(-)
create mode 100644 .idea/jarRepositories.xml
delete mode 100644 .idea/modules.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 96cc43e..fb7f4a8 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,22 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 7990923..4626645 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -1,8 +1,10 @@
+
-
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index d15f572..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
index 7f68460..e497da9 100644
--- a/.idea/runConfigurations.xml
+++ b/.idea/runConfigurations.xml
@@ -3,6 +3,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 55b300b..9fa1341 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -62,11 +62,11 @@ android {
variant.outputs.all { output ->
def project = "facelogin"
def SEP = "."
- def buildType = variant.variantData.variantConfiguration.buildType.name
+ def buildType = variant.buildType.name
def version = variant.versionName
def newApkName = project + SEP + buildType + SEP + version + ".apk"
- outputFileName = new File(output.outputFile.parent, newApkName)
+ outputFileName = new File("./../../../../../build/", newApkName)
}
}
diff --git a/build.gradle b/build.gradle
index c1cf919..a4b32b9 100755
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index c0f38e1..bb8b2fc 100755
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Tue Dec 05 13:11:45 EST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
From 9da09805e0aef032c0ce6d5df76e6643b19dc0c7 Mon Sep 17 00:00:00 2001
From: Sushant <56603153+sushant-varanasi@users.noreply.github.com>
Date: Sun, 22 Aug 2021 02:04:21 +0530
Subject: [PATCH 3/9] Implemented Travis, automatic APK generation
---
.travis.yml | 33 ++++++++++
.../sample_keystore.properties | 4 ++
scripts/updake_apk.sh | 65 +++++++++++++++++++
3 files changed, 102 insertions(+)
create mode 100644 .travis.yml
create mode 100644 sample_config_files/sample_keystore.properties
create mode 100644 scripts/updake_apk.sh
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..ecc077b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,33 @@
+language: android
+dist: trusty
+sudo: false
+jdk:
+ - oraclejdk8
+android:
+ components:
+ - tools
+ - android-26
+ - build-tools-26.0.2
+ - build-tools-29.0.2
+ - platform-tools
+before_cache:
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+cache:
+ directories:
+ - "${TRAVIS_BUILD_DIR}/gradle/caches/"
+ - "${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/"
+ - "$HOME/.gradle/caches/"
+ - "$HOME/.gradle/wrapper/"
+script:
+ - cp -v sample_config_files/sample_keystore.properties keystore.properties
+ - keytool -genkeypair -dname "cn=TravisCI, ou=TravisCI, o=Sun, c=US" -alias business
+ -keypass kpi135 -keystore android.keystore -storepass ab987c -validity 20000
+after_success:
+ - bash scripts/update_apk.sh
+branches:
+ only:
+ - master
+ - development
+env:
+ global:
+ secure: KppMieCLcSsCGRLccTQ53wRtyNEhVKTtpKgLGknm1P8BL2bjIRSmfzNzTskSzmw17JclkUdenPkt4jOz50TF9e5n7IVH+fcixaHyzyH5AmnYqhgi+mVIEa6dQiPChd13oP/QPEn/IODTA9oRgb3f9+9qQSM6nFlft7XpPNBG7mQdrZj6EeEOdoRvB3ntR02YiUaDARve/otLH9OCxtaDclV4GaT5QWH0uQ9nSiJsDUstLLxIefE+mbePKTUOCY1N9NC/mqpqWFfoNz+nl7DZXov60MHAzf8W5xn0wvcrtL8G4SW+sxtf40WWmoLCO2yhXiq+OoyxNxHCN12R0rIx9GUfqeDcMOxcU7u6+meonZ4opWcKcg8xkdjwzNnqrQmqbXeY5YyHBpPxEFhEFQfyk189QF6T6RI/awUXLyJfZ4JKoE+r4ZSRMLxk2suVs9V4IzciIIeMifgZIdIusW3awE9RgLTAB/oEEQJkFsuRuXfD8+c4TmzSSN4SMqER0leEYGJDhcivNRkfyhLU90WiGOM2SH3JBs0M4MLDy/MSTAbjJqClPXWZa3fPDP4+MEa2Xus0EkRHd3VdtLMhNTzsoLNIxqJpPVlmJNJF0RBLIjfjYS51/9Xgyw3T6PBUs1HfOZMEkQjKpLvZnm4UN/IqJXLULKgnOokc6b1Od6BbbA8=
diff --git a/sample_config_files/sample_keystore.properties b/sample_config_files/sample_keystore.properties
new file mode 100644
index 0000000..0699a62
--- /dev/null
+++ b/sample_config_files/sample_keystore.properties
@@ -0,0 +1,4 @@
+storePassword=ab987c
+keyPassword=kpi135
+keyAlias=business
+storeFile=android.keystore
\ No newline at end of file
diff --git a/scripts/updake_apk.sh b/scripts/updake_apk.sh
new file mode 100644
index 0000000..5e8dc01
--- /dev/null
+++ b/scripts/updake_apk.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+set -e
+
+if [ "${TRAVIS_PULL_REQUEST_BRANCH}" == "" ]; then
+ echo "We only work with pull request";
+ exit 0;
+fi
+
+git config --global user.name "Travis CI"
+git config --global user.email "noreply+travis@robotutor.org"
+
+export DEPLOY_BRANCH=${DEPLOY_BRANCH:-development}
+export PUBLISH_BRANCH=${PUBLISH_BRANCH:-master}
+DATE_TODAY=$(date +%Y-%m-%d)
+
+echo $TRAVIS_REPO_SLUG, $TRAVIS_PULL_REQUEST;
+
+release_apk_build () {
+ echo "Building release apk";
+ ./gradlew bundlePlayStoreRelease;
+}
+
+debug_apk_build () {
+ echo "Building debug apk";
+ ./gradlew assembleDebug;
+}
+
+# yes | sdkmanager --licenses
+if [ "${TRAVIS_BRANCH}" == "${PUBLISH_BRANCH}" ]; then
+ release_apk_build
+else
+ debug_apk_build
+fi
+
+
+
+git clone --quiet --branch=apk https://robotutor:$GH_TOKEN@github.com/RoboTutorLLC/RTFace_Login apk > /dev/null
+cd apk
+
+echo `ls`
+find ../app/build/outputs/apk/debug -type f -name '*.apk' -exec mv -v {} temp.apk \;
+
+
+mv temp.apk RTFace_Login-${TRAVIS_PULL_REQUEST_BRANCH}-${DATE_TODAY}.apk
+
+ls
+echo `ls -al`
+git status
+echo $(git status)
+# Create a new branch that will contains only latest apk
+# git checkout --orphan temporary
+
+
+# Add generated APK
+git add .
+git commit -am " ${TRAVIS_BRANCH} : ($(git rev-parse --short HEAD)) : ($(date +%Y-%m-%d.%H:%M:%S))"
+
+# Delete current apk branch
+# git branch -D apk
+# Rename current branch to apk
+# git branch -m apk
+
+# Force push to origin since histories are unrelated
+git push origin apk > /dev/null
\ No newline at end of file
From 60c60dd7e3455bc23a054c1359aed0a9d6581883 Mon Sep 17 00:00:00 2001
From: Sushant <56603153+sushant-varanasi@users.noreply.github.com>
Date: Sun, 22 Aug 2021 02:10:29 +0530
Subject: [PATCH 4/9] rename
---
scripts/{updake_apk.sh => update_apk.sh} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename scripts/{updake_apk.sh => update_apk.sh} (100%)
diff --git a/scripts/updake_apk.sh b/scripts/update_apk.sh
similarity index 100%
rename from scripts/updake_apk.sh
rename to scripts/update_apk.sh
From c1716cce48e59fe71b74a4d55e657ff3082332ad Mon Sep 17 00:00:00 2001
From: rohankulkz <60551302+rohankulkz@users.noreply.github.com>
Date: Tue, 23 Nov 2021 08:25:01 -0800
Subject: [PATCH 5/9] Added Null Checker for SurfaceHolder
---
app/build.gradle | 4 ++--
app/src/main/java/com/example/iris/login1/Common.java | 2 ++
.../main/java/com/example/iris/login1/GalleryActivity.java | 6 ++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 9fa1341..d84b9bf 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 23
+ compileSdkVersion 28
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example.iris.login1"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
- versionName "1.7.5.5"
+ versionName "1.7.5.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/java/com/example/iris/login1/Common.java b/app/src/main/java/com/example/iris/login1/Common.java
index 133a7cc..2a43e29 100755
--- a/app/src/main/java/com/example/iris/login1/Common.java
+++ b/app/src/main/java/com/example/iris/login1/Common.java
@@ -7,6 +7,8 @@
/**
* Created by Zero on 2016/9/16.
+ *
+ *
*/
public class Common {
diff --git a/app/src/main/java/com/example/iris/login1/GalleryActivity.java b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
index 2a14b22..48ccec8 100755
--- a/app/src/main/java/com/example/iris/login1/GalleryActivity.java
+++ b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
@@ -1428,8 +1428,10 @@ public void onClick(View view, int position) {
if (videoThread != null) videoThread.stopPlayingVideo();
int startTimeWithSilence = realStartTime - (language.equals(LANG_EN) ? Common.TRAILING_SILENCE_EN : Common.TRAILING_SILENCE_SW);
// create a new EnrollmentVideo thread
- videoThread = new PlayEnrollmentVideo(surfaceHolder, mHandler, GalleryActivity.this, v, p, startTimeWithSilence);
- videoThread.start();
+ if (surfaceHolder != null) {
+ videoThread = new PlayEnrollmentVideo(surfaceHolder, mHandler, GalleryActivity.this, v, p, startTimeWithSilence);
+ videoThread.start();
+ }
view.setBackgroundColor(Color.YELLOW);
}
});
From 5d944ded92aefbb1fad80425b022481f6c6e44f6 Mon Sep 17 00:00:00 2001
From: rohankulkz <60551302+rohankulkz@users.noreply.github.com>
Date: Wed, 1 Dec 2021 22:56:38 -0800
Subject: [PATCH 6/9] reorganized names from least used to most used -- not
finished yet, still need to reorganize images
---
.idea/deploymentTargetDropDown.xml | 17 ++++++
.idea/gradle.xml | 2 +-
.idea/misc.xml | 13 ++++-
.idea/runConfigurations.xml | 13 -----
.../java/com/example/iris/login1/Common.java | 7 +++
.../com/example/iris/login1/DataHelper.java | 54 +++++++++++++++++++
.../example/iris/login1/GalleryActivity.java | 19 +++++--
.../com/example/iris/login1/SqliteHelper.java | 3 ++
8 files changed, 109 insertions(+), 19 deletions(-)
create mode 100644 .idea/deploymentTargetDropDown.xml
delete mode 100644 .idea/runConfigurations.xml
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..9d601f4
--- /dev/null
+++ b/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 4626645..1f01b64 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,7 +4,7 @@
-
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index e92d2d3..6ca502f 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,5 +1,15 @@
+
+
+
+
+
@@ -25,7 +35,7 @@
-
+
@@ -39,6 +49,7 @@
+
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index e497da9..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/com/example/iris/login1/Common.java b/app/src/main/java/com/example/iris/login1/Common.java
index 2a43e29..1aae709 100755
--- a/app/src/main/java/com/example/iris/login1/Common.java
+++ b/app/src/main/java/com/example/iris/login1/Common.java
@@ -1,6 +1,7 @@
package com.example.iris.login1;
import android.util.Pair;
+import com.example.iris.login1.DataHelper;
import java.util.HashMap;
import java.util.Map;
@@ -13,6 +14,12 @@
public class Common {
// different app states
+
+
+
+
+
+
public enum STATE {
IF_YOU_SEE_YOUR_PICTURE, PLEASE_TAP_ON_YOUR_PICTURE, TO_SEE_MORE_PICTURES,
IF_YOU_DONT_FIND_YOUR_PICTURE, SLIDE_THEM_LIKE_THIS, TAP_HERE_RECORD, PLEASE_SAY_YOUR_NAME,
diff --git a/app/src/main/java/com/example/iris/login1/DataHelper.java b/app/src/main/java/com/example/iris/login1/DataHelper.java
index 0c4f8e1..2051bb8 100755
--- a/app/src/main/java/com/example/iris/login1/DataHelper.java
+++ b/app/src/main/java/com/example/iris/login1/DataHelper.java
@@ -14,6 +14,7 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Locale;
import static com.example.iris.login1.Common.ANIMAL_NAMES_ENG;
import static com.example.iris.login1.Common.ANIMAL_NAMES_SWA;
@@ -215,4 +216,57 @@ public String getTableAsString(String tableName) {
return tableString;
}
+ public String[] getImageOrder() {
+ Log.d("DataHelper","getImageOrder called");
+
+ //users
+ String tableName = SqliteHelper.TB_NAME;
+ //profileIcon
+ String userIcon = UserInfo.PROFILEICON;
+
+
+
+ Cursor values = db.rawQuery("SELECT Count(_id), profileIcon from users Group by profileicon order By Count(_id) ASC", null);
+
+ ArrayList animal_names = new ArrayList();
+ values.moveToFirst();
+
+ while(!values.isAfterLast()){
+ String val = values.getString(values.getColumnIndex("profileIcon"));
+ animal_names.add(val.toLowerCase(Locale.ROOT));
+ values.moveToNext();
+ }
+
+ for (int i = 0; i < ANIMAL_NAMES_ENG.length; i++) {
+
+ boolean is_in_list = true;
+
+ for (int k = 0; k < animal_names.size(); k++) {
+
+ if (animal_names.get(k).equals(ANIMAL_NAMES_ENG[i])) {
+ is_in_list = false;
+ break;
+ }
+ }
+ if(is_in_list){
+ animal_names.add(0,ANIMAL_NAMES_ENG[i]);
+ }
+
+
+ }
+
+
+
+
+//
+
+ String[] response = new String[animal_names.size()];
+ response = animal_names.toArray(response);
+
+ return response;
+
+
+
+ }
+
}
diff --git a/app/src/main/java/com/example/iris/login1/GalleryActivity.java b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
index 48ccec8..c1ab0d3 100755
--- a/app/src/main/java/com/example/iris/login1/GalleryActivity.java
+++ b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
@@ -193,6 +193,9 @@ public class GalleryActivity extends AppCompatActivity implements SurfaceHolder.
private List mIcons = new ArrayList();
private DataHelper dbHelper;
+
+
+
private List userInfo = new ArrayList();
private ImageView capture;
private ImageView like;
@@ -332,6 +335,9 @@ protected void onCreate(Bundle savedInstanceState) {
_audioPlaying = THIS_IS_ROBOTUTOR;
SurfaceHolder holder = this.surfaceview.getHolder();// get holder
+ //Test Below
+ surfaceHolder = holder;
+ //Test Above
holder.addCallback(this); //add the callback interface to the holder
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
@@ -749,6 +755,7 @@ public void onCompletion(MediaPlayer mp) {
firstAttempt = true;
String newSessId = generateSessionID();
currentUser.setLastLoginTime(newSessId.split("_", 2)[1]);
+
dbHelper.updateUserTime(currentUser);
// when the Confirm button is tapped, launch RoboTutor
@@ -1138,7 +1145,8 @@ public void run() {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ String[] ANIMAL_NAMES = dbHelper.getImageOrder();
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1804,7 +1812,8 @@ public boolean onTouch(View v, MotionEvent event) {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ String[] ANIMAL_NAMES = dbHelper.getImageOrder();
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1849,7 +1858,8 @@ public boolean onTouch(View v, MotionEvent event) {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ String[] ANIMAL_NAMES = dbHelper.getImageOrder();
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1951,7 +1961,8 @@ public boolean onTouch(View v, MotionEvent event) {
stopFlash(FLASH_LIKE);
//TODO pick less used
- String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+ String[] ANIMAL_NAMES = dbHelper.getImageOrder();
String icntext = ANIMAL_NAMES[new Random().nextInt(ANIMAL_NAMES.length)];
icontext.setText(icntext.toUpperCase());
diff --git a/app/src/main/java/com/example/iris/login1/SqliteHelper.java b/app/src/main/java/com/example/iris/login1/SqliteHelper.java
index f3f3715..0cf6274 100755
--- a/app/src/main/java/com/example/iris/login1/SqliteHelper.java
+++ b/app/src/main/java/com/example/iris/login1/SqliteHelper.java
@@ -1,12 +1,15 @@
package com.example.iris.login1;
import android.content.Context;
+import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build;
import android.provider.Settings;
import android.util.Log;
+import java.sql.ResultSet;
+
/**
* Created by Iris on 16/7/20.
*/
From 37266e91b451b67369412e209ff8c007639307a5 Mon Sep 17 00:00:00 2001
From: rohankulkz <60551302+rohankulkz@users.noreply.github.com>
Date: Wed, 8 Dec 2021 21:57:34 -0800
Subject: [PATCH 7/9] New Development -- Images and names are reordered on
selector menus.
---
.../java/com/example/iris/login1/Common.java | 25 ++++++++---
.../com/example/iris/login1/DataHelper.java | 41 ++++++++++++++-----
.../example/iris/login1/GalleryActivity.java | 21 ++++++----
3 files changed, 63 insertions(+), 24 deletions(-)
diff --git a/app/src/main/java/com/example/iris/login1/Common.java b/app/src/main/java/com/example/iris/login1/Common.java
index 1aae709..655bfd2 100755
--- a/app/src/main/java/com/example/iris/login1/Common.java
+++ b/app/src/main/java/com/example/iris/login1/Common.java
@@ -36,7 +36,7 @@ public enum STATE {
TO_SEE_MORE_ICONS, SLIDE_ICONS_LIKE_THIS
}
- public static final String[] ANIMAL_NAMES_ENG = {"bat", "bear", "bee", "buffalo", "butterfly",
+ public static String[] ANIMAL_NAMES_ENG = {"bat", "bear", "bee", "buffalo", "butterfly",
"camel", "cat", "cheetah", "chicken", "chimpanzee", "cow", "crocodile", "dog", "donkey", "dove",
"duck", "eagle", "elephant", "fish", "flamingo", "fox", "frog", "giraffe", "goat", "gorilla", "hippo", "horse",
"hyena", "kangaroo", "leopard", "lion", "monkey", "mouse", "ostrich", "parrot","rabbit",
@@ -45,13 +45,13 @@ public enum STATE {
// chimp and gorilla => sokwe
// zebra and donkey => punda
- public static final String[] ANIMAL_NAMES_SWA = {"popo", "dubu", "nyuki", "nyati", "kipepeo",
+ public static String[] ANIMAL_NAMES_SWA = {"popo", "dubu", "nyuki", "nyati", "kipepeo",
"ngamia", "paka", "duma", "kuku", "sokwe (chimpanzee)", "ng'ombe", "mamba", "mbwa", "punda (donkey)", "njiwa",
"bata", "tai", "tembo", "samaki", "korongo", "mbweha", "chura", "twiga", "mbuzi", "sokwe (gorilla)", "kiboko", "farasi",
"fisi", "kangaruu", "chui", "simba", "tumbili", "panya", "mbuni", "kasuku","sungura",
"kondoo", "nyoka", "buibui", "kuchakuro", "kobe", "mbwa mwitu", "punda (zebra)"};
- public static final int[] ANIMAL_PATHS = {R.drawable.bat, R.drawable.bear, R.drawable.bee, R.drawable.buffalo,
+ public static int[] ANIMAL_PATHS = {R.drawable.bat, R.drawable.bear, R.drawable.bee, R.drawable.buffalo,
R.drawable.butterfly, R.drawable.camel, R.drawable.cat, R.drawable.cheetah,
R.drawable.chicken, R.drawable.chimpanzee, R.drawable.cow, R.drawable.crocodile, R.drawable.dog,
R.drawable.donkey, R.drawable.dove, R.drawable.duck, R.drawable.eagle, R.drawable.elephant,
@@ -62,25 +62,38 @@ public enum STATE {
R.drawable.spider, R.drawable.squirrel, R.drawable.turtle,
R.drawable.wolf, R.drawable.zebra};
- public static final int[] ANIMAL_SOUNDS = {R.raw.popo, R.raw.dubu, R.raw.nyuki, R.raw.nyati, R.raw.kipepeo,
+ public static int[] ANIMAL_SOUNDS = {R.raw.popo, R.raw.dubu, R.raw.nyuki, R.raw.nyati, R.raw.kipepeo,
R.raw.ngamia, R.raw.paka, R.raw.duma, R.raw.kuku, R.raw.sokwe, R.raw.ng_ombe, R.raw.mamba, R.raw.mbwa,
R.raw.punda, R.raw.njiwa, R.raw.bata, R.raw.tai, R.raw.tembo, R.raw.samaki, R.raw.korongo, R.raw.mbweha,
R.raw.chura, R.raw.twiga, R.raw.mbuzi, R.raw.sokwe, R.raw.kiboko, R.raw.farasi, R.raw.fisi, R.raw.kangaruu,
R.raw.chui, R.raw.simba, R.raw.tumbili, R.raw.panya, R.raw.mbuni, R.raw.kasuku, R.raw.sungura, R.raw.kondoo,
R.raw.nyoka, R.raw.buibui, R.raw.kuchakuro, R.raw.kobe, R.raw.mbwa_mwitu, R.raw.punda};
- public static final Map> ANIMALS_ENG = new HashMap>() {{
+ public static Map> ANIMALS_ENG = new HashMap>() {{
for(int i = 0; i < ANIMAL_NAMES_ENG.length; i++){
put(ANIMAL_NAMES_ENG[i], Pair.create(ANIMAL_PATHS[i], ANIMAL_SOUNDS[i]));
}
}};
- public static final Map> ANIMALS_SWA = new HashMap>() {{
+ public static Map> ANIMALS_SWA = new HashMap>() {{
for(int i = 0; i < ANIMAL_NAMES_SWA.length; i++){
put(ANIMAL_NAMES_SWA[i], Pair.create(ANIMAL_PATHS[i], ANIMAL_SOUNDS[i]));
}
}};
+
+ //method remaps the hashmaps to the new order.
+ public static void reMap(){
+ ANIMALS_ENG.clear();
+ ANIMALS_SWA.clear();
+ for(int i = 0; i < ANIMAL_NAMES_ENG.length; i++){
+ ANIMALS_ENG.put(ANIMAL_NAMES_ENG[i], Pair.create(ANIMAL_PATHS[i], ANIMAL_SOUNDS[i]));
+ }
+ for(int i = 0; i < ANIMAL_NAMES_SWA.length; i++){
+ ANIMALS_SWA.put(ANIMAL_NAMES_SWA[i], Pair.create(ANIMAL_PATHS[i], ANIMAL_SOUNDS[i]));
+ }
+ }
+
//indicate the delay time
public static final int DELAY_TO_SHOW_VIDEO_FULL_SCREEN = 7000;
public static final int DELAY_TO_SHOW_VIDEO = 5000;
diff --git a/app/src/main/java/com/example/iris/login1/DataHelper.java b/app/src/main/java/com/example/iris/login1/DataHelper.java
index 2051bb8..b92d0ff 100755
--- a/app/src/main/java/com/example/iris/login1/DataHelper.java
+++ b/app/src/main/java/com/example/iris/login1/DataHelper.java
@@ -6,6 +6,7 @@
import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.util.Log;
+import android.util.Pair;
import java.io.File;
import java.text.SimpleDateFormat;
@@ -16,8 +17,11 @@
import java.util.List;
import java.util.Locale;
+import static com.example.iris.login1.Common.ANIMALS_ENG;
import static com.example.iris.login1.Common.ANIMAL_NAMES_ENG;
import static com.example.iris.login1.Common.ANIMAL_NAMES_SWA;
+import static com.example.iris.login1.Common.ANIMAL_PATHS;
+import static com.example.iris.login1.Common.ANIMAL_SOUNDS;
import static com.example.iris.login1.Common.FACE_LOGIN_PATH;
/**
@@ -218,14 +222,6 @@ public String getTableAsString(String tableName) {
public String[] getImageOrder() {
Log.d("DataHelper","getImageOrder called");
-
- //users
- String tableName = SqliteHelper.TB_NAME;
- //profileIcon
- String userIcon = UserInfo.PROFILEICON;
-
-
-
Cursor values = db.rawQuery("SELECT Count(_id), profileIcon from users Group by profileicon order By Count(_id) ASC", null);
ArrayList animal_names = new ArrayList();
@@ -237,6 +233,8 @@ public String[] getImageOrder() {
values.moveToNext();
}
+ int startingListLength = animal_names.size();
+
for (int i = 0; i < ANIMAL_NAMES_ENG.length; i++) {
boolean is_in_list = true;
@@ -255,14 +253,37 @@ public String[] getImageOrder() {
}
+ for (int i = 0; i < (int)(ANIMAL_NAMES_ENG.length-startingListLength)/2; i++) {
+ String placeholder = animal_names.get(i);
+ animal_names.set(i,animal_names.get(ANIMAL_NAMES_ENG.length-startingListLength-i));
+ animal_names.set(ANIMAL_NAMES_ENG.length-startingListLength-i,placeholder);
-//
+ }
+
+
+
+
+ for (int i = 0; i < ANIMAL_NAMES_ENG.length; i++) {
+
+ ANIMAL_NAMES_ENG[i] = animal_names.get(i);
+
+ String tempName = animal_names.get(i);
+ Pair animalData = ANIMALS_ENG.get(tempName);
+
+ ANIMAL_PATHS[i] = animalData.first;
+ ANIMAL_SOUNDS[i] = animalData.second;
+
+ }
+
+ //Common.reMap();
+
+
+//
String[] response = new String[animal_names.size()];
response = animal_names.toArray(response);
-
return response;
diff --git a/app/src/main/java/com/example/iris/login1/GalleryActivity.java b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
index c1ab0d3..7522e87 100755
--- a/app/src/main/java/com/example/iris/login1/GalleryActivity.java
+++ b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
@@ -1145,8 +1145,9 @@ public void run() {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
- String[] ANIMAL_NAMES = dbHelper.getImageOrder();
+ dbHelper.getImageOrder();
+ String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1454,6 +1455,8 @@ private void initUserInfo(){
String tempUrl = userInfo.get(i).getUserIcon();
String profIconName = userInfo.get(i).getProfileIcon().toLowerCase();
+ dbHelper.getImageOrder();
+
Integer profIcon = (language.equals(LANG_EN) ? ANIMALS_ENG.get(profIconName).first : ANIMALS_SWA.get(profIconName).first);
Bitmap bmp = BitmapFactory.decodeFile(tempUrl);
@@ -1812,8 +1815,9 @@ public boolean onTouch(View v, MotionEvent event) {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
- String[] ANIMAL_NAMES = dbHelper.getImageOrder();
+ dbHelper.getImageOrder();
+ String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1858,8 +1862,9 @@ public boolean onTouch(View v, MotionEvent event) {
genderlay.setVisibility(View.GONE);
//TODO pick less used
- //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
- String[] ANIMAL_NAMES = dbHelper.getImageOrder();
+ dbHelper.getImageOrder();
+ String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
+
Integer icnpic = mIcons.get(0);
String icntext = ANIMAL_NAMES[0];
@@ -1960,9 +1965,9 @@ public boolean onTouch(View v, MotionEvent event) {
stopFlash(FLASH_DISLIKE);
stopFlash(FLASH_LIKE);
//TODO pick less used
+ dbHelper.getImageOrder();
+ String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
- //String[] ANIMAL_NAMES = (language.equals(LANG_EN) ? ANIMAL_NAMES_ENG : ANIMAL_NAMES_SWA);
- String[] ANIMAL_NAMES = dbHelper.getImageOrder();
String icntext = ANIMAL_NAMES[new Random().nextInt(ANIMAL_NAMES.length)];
icontext.setText(icntext.toUpperCase());
From a18700e5409291710b60fbf5b322fd445f746b3e Mon Sep 17 00:00:00 2001
From: rohankulkz <60551302+rohankulkz@users.noreply.github.com>
Date: Thu, 9 Dec 2021 07:06:57 -0800
Subject: [PATCH 8/9] New Development -- Images and names are reordered on
selector menus.
---
app/src/main/java/com/example/iris/login1/DataHelper.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/app/src/main/java/com/example/iris/login1/DataHelper.java b/app/src/main/java/com/example/iris/login1/DataHelper.java
index b92d0ff..e6e982e 100755
--- a/app/src/main/java/com/example/iris/login1/DataHelper.java
+++ b/app/src/main/java/com/example/iris/login1/DataHelper.java
@@ -278,9 +278,6 @@ public String[] getImageOrder() {
}
- //Common.reMap();
-
-
//
String[] response = new String[animal_names.size()];
response = animal_names.toArray(response);
From 1d3ee0bb9fb5750180d1cbbf8121f7cfe5164ba5 Mon Sep 17 00:00:00 2001
From: rohankulkz <60551302+rohankulkz@users.noreply.github.com>
Date: Wed, 29 Dec 2021 12:54:58 -0800
Subject: [PATCH 9/9] Swahili is also reordered
---
.idea/deploymentTargetDropDown.xml | 4 ++--
app/build.gradle | 5 ++++-
.../main/java/com/example/iris/login1/Common.java | 8 ++++++++
.../java/com/example/iris/login1/DataHelper.java | 13 +++++++++----
.../com/example/iris/login1/GalleryActivity.java | 7 +++----
5 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 9d601f4..ec95eb1 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -7,11 +7,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index d84b9bf..1632ddf 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,7 +8,10 @@ android {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
- versionName "1.7.5.7"
+
+ //Previous was 1.7.5.7 => 1.7.5.6
+
+ versionName "1.8.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/java/com/example/iris/login1/Common.java b/app/src/main/java/com/example/iris/login1/Common.java
index 655bfd2..622d241 100755
--- a/app/src/main/java/com/example/iris/login1/Common.java
+++ b/app/src/main/java/com/example/iris/login1/Common.java
@@ -69,6 +69,14 @@ public enum STATE {
R.raw.chui, R.raw.simba, R.raw.tumbili, R.raw.panya, R.raw.mbuni, R.raw.kasuku, R.raw.sungura, R.raw.kondoo,
R.raw.nyoka, R.raw.buibui, R.raw.kuchakuro, R.raw.kobe, R.raw.mbwa_mwitu, R.raw.punda};
+ public static Map ANIMALS_Link = new HashMap() {{
+ for(int i = 0; i < ANIMAL_NAMES_ENG.length; i++){
+ put(ANIMAL_NAMES_ENG[i],ANIMAL_NAMES_SWA[i]);
+ }
+ }};
+
+
+
public static Map> ANIMALS_ENG = new HashMap>() {{
for(int i = 0; i < ANIMAL_NAMES_ENG.length; i++){
put(ANIMAL_NAMES_ENG[i], Pair.create(ANIMAL_PATHS[i], ANIMAL_SOUNDS[i]));
diff --git a/app/src/main/java/com/example/iris/login1/DataHelper.java b/app/src/main/java/com/example/iris/login1/DataHelper.java
index e6e982e..6286628 100755
--- a/app/src/main/java/com/example/iris/login1/DataHelper.java
+++ b/app/src/main/java/com/example/iris/login1/DataHelper.java
@@ -18,6 +18,7 @@
import java.util.Locale;
import static com.example.iris.login1.Common.ANIMALS_ENG;
+import static com.example.iris.login1.Common.ANIMALS_Link;
import static com.example.iris.login1.Common.ANIMAL_NAMES_ENG;
import static com.example.iris.login1.Common.ANIMAL_NAMES_SWA;
import static com.example.iris.login1.Common.ANIMAL_PATHS;
@@ -225,6 +226,7 @@ public String[] getImageOrder() {
Cursor values = db.rawQuery("SELECT Count(_id), profileIcon from users Group by profileicon order By Count(_id) ASC", null);
ArrayList animal_names = new ArrayList();
+ ArrayList animal_names_swa = new ArrayList();
values.moveToFirst();
while(!values.isAfterLast()){
@@ -263,19 +265,22 @@ public String[] getImageOrder() {
}
-
-
for (int i = 0; i < ANIMAL_NAMES_ENG.length; i++) {
-
+ String tempName = animal_names.get(i);
ANIMAL_NAMES_ENG[i] = animal_names.get(i);
- String tempName = animal_names.get(i);
+
+
+ ;
Pair animalData = ANIMALS_ENG.get(tempName);
ANIMAL_PATHS[i] = animalData.first;
ANIMAL_SOUNDS[i] = animalData.second;
+
+ ANIMAL_NAMES_SWA[i] = ANIMALS_Link.get(tempName);
+
}
//
diff --git a/app/src/main/java/com/example/iris/login1/GalleryActivity.java b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
index 7522e87..75db65c 100755
--- a/app/src/main/java/com/example/iris/login1/GalleryActivity.java
+++ b/app/src/main/java/com/example/iris/login1/GalleryActivity.java
@@ -1437,10 +1437,9 @@ public void onClick(View view, int position) {
if (videoThread != null) videoThread.stopPlayingVideo();
int startTimeWithSilence = realStartTime - (language.equals(LANG_EN) ? Common.TRAILING_SILENCE_EN : Common.TRAILING_SILENCE_SW);
// create a new EnrollmentVideo thread
- if (surfaceHolder != null) {
- videoThread = new PlayEnrollmentVideo(surfaceHolder, mHandler, GalleryActivity.this, v, p, startTimeWithSilence);
- videoThread.start();
- }
+ videoThread = new PlayEnrollmentVideo(surfaceHolder, mHandler, GalleryActivity.this, v, p, startTimeWithSilence);
+ videoThread.start();
+
view.setBackgroundColor(Color.YELLOW);
}
});