Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Multi-User and progress tracking functionality #18

Open
wants to merge 108 commits into
base: newmaster
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
0d06f85
Added gamesClearedInTotal to the UserDefault database
onetruffle May 29, 2019
e638e42
Added progress columns
onetruffle May 29, 2019
569ca00
Granted mainapp resource permissions to the launcher
onetruffle May 29, 2019
fd5926b
Correction about sharedUserId
onetruffle May 30, 2019
da02526
Add columns
onetruffle May 30, 2019
ce423b8
Added coins to the table
onetruffle May 30, 2019
ec329d0
Added progress variable to each user
onetruffle May 30, 2019
795b032
Revert "Correction about sharedUserId"
onetruffle May 30, 2019
651c195
Revert "Granted mainapp resource permissions to the launcher"
onetruffle May 30, 2019
9be55d1
Minor changes
onetruffle May 30, 2019
b48fa21
Changes
May 30, 2019
c505118
Changes
May 30, 2019
f2c112b
Changes
May 30, 2019
70fadf1
Very minor changes
May 31, 2019
25f2183
Revert "Changes"
onetruffle May 31, 2019
6fbad45
Minor Change
May 31, 2019
6373745
Fix sharedUserId for access
onetruffle May 31, 2019
c3d9ac8
Added a column
onetruffle May 31, 2019
2f75f9a
Changes
May 31, 2019
b1b0df4
Minor changes
May 31, 2019
699becd
Minor changes
May 31, 2019
0840358
Minor changes
May 31, 2019
dca0685
Minor Changes
May 31, 2019
ae715ad
Merge branch 'SanchitT/MultiUserFunctionality' into UserProfile_Progr…
onetruffle May 31, 2019
21a057a
.
onetruffle May 31, 2019
dbf414f
Merge branch 'SaitarunI/ProgressTracker' into UserProfile_ProgressTra…
onetruffle May 31, 2019
8707fd8
Update strings.xml
onetruffle May 31, 2019
2af22fb
Update User.java
onetruffle May 31, 2019
4ec66c8
Minor changes
May 31, 2019
762dc09
minor change
May 31, 2019
1b56336
Update FirstScreen.java
Jun 1, 2019
3566ec0
Changes
Jun 1, 2019
5ebff1b
Update build.gradle
Jun 1, 2019
a4b18bb
Update FirstScreen.java
Jun 3, 2019
62e80ae
Update UserNameListDialog.java
onetruffle Jun 3, 2019
9b74978
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
onetruffle Jun 3, 2019
fb93084
Revert "Update build.gradle"
Jun 3, 2019
e3dacb5
Revert "Changes"
Jun 3, 2019
e50d99b
Reverted the changes of gradle files
Jun 3, 2019
d20e3e1
Updated the file name and removed unused code
Jun 3, 2019
b8dc0e6
Update MultiUserActivity.java
Jun 3, 2019
e866205
Update MultiUserActivity.java
Jun 3, 2019
2b0f25c
Update MultiUserActivity.java
Jun 3, 2019
d4916a3
Updated the UI of adding the user and removed unsued code
Jun 3, 2019
76a31e5
Removed the unused variables
Jun 3, 2019
78138e9
Update MultiUserActivity.java
Jun 3, 2019
4f5933a
Update in Manifest and multi_user layout
Jun 4, 2019
d588e9d
Removed unused code
Jun 4, 2019
15e4826
Updated the shared user id
Jun 4, 2019
b107eac
Updated the shared user id of launcher release app
Jun 4, 2019
7ef828a
Merge branch 'newmaster' into UserProfile_ProgressTracker_Integration
Jun 4, 2019
2572b21
Fixed the issue of coins
Jun 4, 2019
08aa7a6
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 4, 2019
0233c30
Updated the SharedUserId, fixed the SetUser function, updated the lau…
Jun 4, 2019
e1cecf3
Changed the sharedUserId in release Android Manifest
Jun 4, 2019
365dfef
Resolved issues of severity "error" and "portability"
onetruffle Jun 4, 2019
c058f20
Resolve issues of severity "performance"
onetruffle Jun 5, 2019
e4d24cb
Resolve more issues of severity "performance"
onetruffle Jun 5, 2019
4833052
Resolve more issues of severity "performance"
onetruffle Jun 5, 2019
005be84
Changed the add and select buttons image in activity_multi_user
Jun 5, 2019
b2963fc
fixes
onetruffle Jun 5, 2019
56e671a
Resolve more issures of severity "performance"
onetruffle Jun 6, 2019
71ee474
Changes in Add and Select user UI
Jun 6, 2019
6463153
Merge branch 'newmaster' into UserProfile_ProgressTracker_Integration
Jun 6, 2019
6fda6d3
Resolved issues of severity "warning"
onetruffle Jun 6, 2019
5f04b9e
Updated the Add and Select User layout
Jun 7, 2019
343b6af
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 7, 2019
e78f16f
Updated the layout of add user
Jun 7, 2019
69e4cbd
Fixed the layout for all devices
Jun 7, 2019
b218bbd
Add User functionality and Select User UI progress
Jun 8, 2019
0406c45
Added Select User Functionality
Jun 11, 2019
d17f928
Updated Select User and Main Activity
Jun 12, 2019
d0e53dd
Updated Add User
Jun 12, 2019
c8a4333
Resolve lint errors
onetruffle Jun 12, 2019
3448658
Severity "error"
onetruffle Jun 12, 2019
f48aa97
Updated the code to redirect the user to the multi-user activity
Jun 12, 2019
c3ad95a
Added code to fetch the current page
Jun 13, 2019
83d36d8
Update MultiUserActivity.java
Jun 13, 2019
22c0c49
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 13, 2019
ba5860a
Added Edit User fuctionality and cleaned the code
Jun 13, 2019
a806b11
Revert "Severity "error""
onetruffle Jun 13, 2019
4224230
Merge branch 'newmaster' into SaitarunI/StaticCodeAnalysis_6_11
onetruffle Jun 13, 2019
d627670
Made Image to appear in circle and made multi_user.sml responsive and…
Jun 13, 2019
e64e4e2
Resolve cpp issues of severity "style"
onetruffle Jun 14, 2019
bf04dc4
Resolve cpp issues
onetruffle Jun 14, 2019
69193b7
Fixed the UI and Edit User
Jun 14, 2019
e6fca9b
Updated the version and obb size
Jun 14, 2019
7bcc11a
Revert "Updated the version and obb size"
Jun 14, 2019
60076f5
Fixed Minimum user age and Back button UI and English,Maths progress …
Jun 14, 2019
f1de7e8
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 14, 2019
b6fd90d
Fixed Select User UI
Jun 15, 2019
4a56e4c
Merge branch 'SaitarunI/StaticCodeAnalysis_6_14' into UserProfile_Pro…
onetruffle Jun 15, 2019
f90e596
Resolved Comments
Jun 15, 2019
da52e24
Fixed the Back Button and User Image
Jun 17, 2019
a897a79
Fixed the usr image and button width in edit user
Jun 17, 2019
4fe298e
Updated the logic to fetch the user details
Jun 17, 2019
5e86ab3
UI chenges
Jun 17, 2019
4e2f290
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 17, 2019
0c818ff
Fixed Current User and Delete User and Add User method
Jun 17, 2019
4aaa391
Merge branch 'newmaster' into UserProfile_ProgressTracker_Integration
Jun 17, 2019
9730142
Merge branch 'newmaster' into UserProfile_ProgressTracker_Integration
Jun 17, 2019
d9d497d
Fixed the register button, Back Button and improved UI
Jun 17, 2019
c2c845f
Merge branch 'UserProfile_ProgressTracker_Integration' of https://git…
Jun 17, 2019
6e82c12
Merged with master
Jun 17, 2019
33803d0
Removed unused methods and fixed the files
Jun 17, 2019
47d3d67
Updated the files
Jun 17, 2019
e19a80c
Removed Display Name, Fixed the Launcher first screen, added back but…
Jun 17, 2019
efc542a
Added previus and next image button. Also fixed user image in main ac…
Jun 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import java.util.List;
import java.util.Locale;

import static android.content.ContentValues.TAG;

/**
* Created by ingtellect on 9/1/17.
*/
Expand All @@ -33,6 +35,8 @@ public class KitkitDBHandler extends SQLiteOpenHelper {

public static final String COLUMN_ID = "_id";
public static final String COLUMN_USERNAME = "username";
public static final String COLUMN_AGE = "_age";
public static final String COLUMN_IMAGE = "_image";
public static final String COLUMN_STARS = "stars";
public static final String COLUMN_FINISH_TUTORIAL = "finish_tutorial";
public static final String COLUMN_UNLOCK_DRUM = "unlock_drum";
Expand Down Expand Up @@ -63,6 +67,8 @@ public class KitkitDBHandler extends SQLiteOpenHelper {
+ "("
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ COLUMN_USERNAME + " TEXT,"
+ COLUMN_AGE + " TEXT,"
+ COLUMN_IMAGE + " BLOB,"
+ COLUMN_STARS + " INTEGER,"
+ COLUMN_FINISH_TUTORIAL + " BOOLEAN,"
+ COLUMN_UNLOCK_DRUM + " BOOLEAN,"
Expand All @@ -83,7 +89,8 @@ public class KitkitDBHandler extends SQLiteOpenHelper {
+ TABLE_CURRENT_USER
+ "("
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ COLUMN_USERNAME + " TEXT"
+ COLUMN_USERNAME + " TEXT,"
+ COLUMN_AGE + " TEXT"
+ ")";

final String CREATE_SNTP_RESULT_TABLE = "CREATE TABLE "
Expand Down Expand Up @@ -160,6 +167,8 @@ private void execRawQuery(SQLiteDatabase db, String[] arr_sql) {
public void addUser(User user) {
ContentValues values = new ContentValues();
values.put(COLUMN_USERNAME, user.getUserName());
values.put(COLUMN_AGE, user.getAge());
values.put(COLUMN_IMAGE, user.getImage());
values.put(COLUMN_STARS, user.getNumStars());
values.put(COLUMN_FINISH_TUTORIAL, user.isFinishTutorial());
values.put(COLUMN_UNLOCK_DRUM, user.isUnlockDrum());
Expand All @@ -168,6 +177,7 @@ public void addUser(User user) {
values.put(COLUMN_UNLOCK_COLORING, user.isUnlockColoring());
values.put(COLUMN_UNLOCK_BLACKBOARD, user.isUnlockBlackboard());
values.put(COLUMN_FINISH_LAUNCHER_TUTORIAL, user.isFinishLauncherTutorial());
values.put(COLUMN_DISPLAY_NAME,user.getDisplayName());
values.put(COLUMN_OPEN_LIBRARY, user.isOpenLibrary());
values.put(COLUMN_OPEN_TOOLS, user.isOpenTools());
values.put(COLUMN_UNLOCK_FISH_BOWL, user.isUnlockFishBowl());
Expand All @@ -180,6 +190,8 @@ public void addUser(User user) {
public User findUser(String username) {
String[] projection = {COLUMN_ID,
COLUMN_USERNAME,
COLUMN_AGE,
COLUMN_IMAGE,
COLUMN_STARS,
COLUMN_FINISH_TUTORIAL,
COLUMN_UNLOCK_DRUM,
Expand Down Expand Up @@ -208,20 +220,22 @@ public User findUser(String username) {
cursor.moveToFirst();
user.setID(Integer.parseInt(cursor.getString(0)));
user.setUserName(cursor.getString(1));
user.setNumStars(Integer.parseInt(cursor.getString(2)));
user.setFinishTutorial("1".equals(cursor.getString(3)));
user.setUnlockDrum("1".equals(cursor.getString(4)));
user.setUnlockMarimba("1".equals(cursor.getString(5)));
user.setUnlockDrawing("1".equals(cursor.getString(6)));
user.setUnlockColoring("1".equals(cursor.getString(7)));
user.setUnlockBlackboard("1".equals(cursor.getString(8)));
user.setFinishLauncherTutorial("1".equals(cursor.getString(9)));
user.setDisplayName(cursor.getString(10));
user.setOpenLibrary("1".equals(cursor.getString(11)));
user.setOpenTools("1".equals(cursor.getString(12)));
user.setUnlockFishBowl("1".equals(cursor.getString(13)));
user.setUnlockWritingBoard("1".equals(cursor.getString(14)));
user.setFinishWritingBoardTutorial("1".equals(cursor.getString(15)));
user.setAge((cursor.getString(2)));
user.setImage(cursor.getBlob(3));
user.setNumStars(Integer.parseInt(cursor.getString(4)));
user.setFinishTutorial("1".equals(cursor.getString(5)));
user.setUnlockDrum("1".equals(cursor.getString(6)));
user.setUnlockMarimba("1".equals(cursor.getString(7)));
user.setUnlockDrawing("1".equals(cursor.getString(8)));
user.setUnlockColoring("1".equals(cursor.getString(9)));
user.setUnlockBlackboard("1".equals(cursor.getString(10)));
user.setFinishLauncherTutorial("1".equals(cursor.getString(11)));
user.setDisplayName(cursor.getString(12));
user.setOpenLibrary("1".equals(cursor.getString(13)));
user.setOpenTools("1".equals(cursor.getString(14)));
user.setUnlockFishBowl("1".equals(cursor.getString(15)));
user.setUnlockWritingBoard("1".equals(cursor.getString(16)));
user.setFinishWritingBoardTutorial("1".equals(cursor.getString(17)));
cursor.close();
} else {
user = null;
Expand All @@ -233,6 +247,8 @@ public User findUser(String username) {
public ArrayList<User> getUserList() {
String[] projection = {COLUMN_ID,
COLUMN_USERNAME,
COLUMN_AGE,
COLUMN_IMAGE,
COLUMN_STARS,
COLUMN_FINISH_TUTORIAL,
COLUMN_UNLOCK_DRUM,
Expand All @@ -259,20 +275,22 @@ public ArrayList<User> getUserList() {
User user = new User();
user.setID(Integer.parseInt(cursor.getString(0)));
user.setUserName(cursor.getString(1));
user.setNumStars(Integer.parseInt(cursor.getString(2)));
user.setFinishTutorial("1".equals(cursor.getString(3)));
user.setUnlockDrum("1".equals(cursor.getString(4)));
user.setUnlockMarimba("1".equals(cursor.getString(5)));
user.setUnlockDrawing("1".equals(cursor.getString(6)));
user.setUnlockColoring("1".equals(cursor.getString(7)));
user.setUnlockBlackboard("1".equals(cursor.getString(8)));
user.setFinishLauncherTutorial("1".equals(cursor.getString(9)));
user.setDisplayName(cursor.getString(10));
user.setOpenLibrary("1".equals(cursor.getString(11)));
user.setOpenTools("1".equals(cursor.getString(12)));
user.setUnlockFishBowl("1".equals(cursor.getString(13)));
user.setUnlockWritingBoard("1".equals(cursor.getString(14)));
user.setFinishWritingBoardTutorial("1".equals(cursor.getString(15)));
user.setAge((cursor.getString(2)));
user.setImage(cursor.getBlob(3));
user.setNumStars(Integer.parseInt(cursor.getString(4)));
user.setFinishTutorial("1".equals(cursor.getString(5)));
user.setUnlockDrum("1".equals(cursor.getString(6)));
user.setUnlockMarimba("1".equals(cursor.getString(7)));
user.setUnlockDrawing("1".equals(cursor.getString(8)));
user.setUnlockColoring("1".equals(cursor.getString(9)));
user.setUnlockBlackboard("1".equals(cursor.getString(10)));
user.setFinishLauncherTutorial("1".equals(cursor.getString(11)));
user.setDisplayName(cursor.getString(12));
user.setOpenLibrary("1".equals(cursor.getString(13)));
user.setOpenTools("1".equals(cursor.getString(14)));
user.setUnlockFishBowl("1".equals(cursor.getString(15)));
user.setUnlockWritingBoard("1".equals(cursor.getString(16)));
user.setFinishWritingBoardTutorial("1".equals(cursor.getString(17)));
result.add(user);

} while(cursor.moveToNext());
Expand Down Expand Up @@ -370,6 +388,7 @@ public User getCurrentUser() {
}

String currentUserName = cursor.getString(0);
Log.d(TAG,"HelloWord"+currentUserName);
User user = findUser(currentUserName);
cursor.close();
return user;
Expand All @@ -387,15 +406,18 @@ public String getCurrentUsername() {
}
String result = cursor.getString(0);
cursor.close();
Log.d(TAG,"HelloWord1"+result);
return result;
}

public void updateUser(User user) {

String selection = "username = \"" + user.getUserName() + "\"";

try{
SanchitTaliyan marked this conversation as resolved.
Show resolved Hide resolved
ContentValues values = new ContentValues();
values.put(COLUMN_USERNAME, user.getUserName());
values.put(COLUMN_AGE, user.getAge());
values.put(COLUMN_IMAGE, user.getImage());
values.put(COLUMN_STARS, user.getNumStars());
values.put(COLUMN_FINISH_TUTORIAL, user.isFinishTutorial());
values.put(COLUMN_UNLOCK_DRUM, user.isUnlockDrum());
Expand All @@ -412,6 +434,10 @@ public void updateUser(User user) {
values.put(COLUMN_FINISH_WRITING_BOARD_TUTORIAL, user.isFinishWritingBoardTutorial());
Log.i("myLog", "value : " + values.toString());
myCR.update(KitkitProvider.CONTENT_URI, values, selection, null);
}
catch (Exception e){
Log.e(TAG,"error updating coin:-"+e.getMessage());
}
}

public void uniqueInsertSntpResult(SntpResult sntpResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
*/


public class User {
public class User<string> {
public static boolean DEFAULT_OPEN_LIBRARY = true;
public static boolean DEFAULT_OPEN_TOOLS = true;

private int _id;
private String _username;
private String _age;
byte[] _image;
private int _numStars;
private boolean _finishTutorial;
private boolean _unlockDrum;
Expand All @@ -25,10 +27,14 @@ public class User {
private boolean _unlockFishBowl;
private boolean _unlockWritingBoard;
private boolean _finishWritingBoardTutorial;
private int _gamesClearedInTotal_L;
private int _gamesClearedInTotal_M;
SanchitTaliyan marked this conversation as resolved.
Show resolved Hide resolved

public User() {
this._id = 0;
this._username = "user";
this._image = new byte[]{(byte) 204};
this._age = "0";
this._numStars = 0;
this._finishTutorial = false;
this._unlockDrum = true;
Expand All @@ -43,11 +49,38 @@ public User() {
this._unlockFishBowl = false;
this._unlockWritingBoard = false;
this._finishWritingBoardTutorial = false;
this._gamesClearedInTotal_L = 0;
this._gamesClearedInTotal_M = 0;
}

public User(String displayname, String age, byte[] image) {
this._id = 0;
this._username = displayname;
this._age = age;
this._image = image;
this._numStars = 0;
this._finishTutorial = false;
this._unlockDrum = true;
this._unlockMarimba = true;
this._unlockDrawing = true;
this._unlockColoring = true;
this._unlockBlackboard = true;
this._finishLauncherTutorial = false;
this._displayName = displayname;
this._openLibrary = DEFAULT_OPEN_LIBRARY;
this._openTools = DEFAULT_OPEN_TOOLS;
this._unlockFishBowl = false;
this._unlockWritingBoard = false;
this._finishWritingBoardTutorial = false;
this._gamesClearedInTotal_L = 0;
this._gamesClearedInTotal_M = 0;
}

public User(int id, String username, int stars) {
this._id = id;
this._username = username;
this._age = "0";
this._image = new byte[]{(byte) 204};
this._numStars = stars;
this._finishTutorial = false;
this._unlockDrum = true;
Expand All @@ -62,10 +95,14 @@ public User(int id, String username, int stars) {
this._unlockFishBowl = false;
this._unlockWritingBoard = false;
this._finishWritingBoardTutorial = false;
this._gamesClearedInTotal_L = 0;
this._gamesClearedInTotal_M = 0;
}

public User(String productname, int stars) {
this._username = productname;
this._age = "0";
this._image = new byte[]{(byte) 204};
this._numStars = stars;
this._finishTutorial = false;
this._unlockDrum = true;
Expand All @@ -80,6 +117,8 @@ public User(String productname, int stars) {
this._unlockFishBowl = false;
this._unlockWritingBoard = false;
this._finishWritingBoardTutorial = false;
this._gamesClearedInTotal_L = 0;
this._gamesClearedInTotal_M = 0;
}

public void setID(int id) {
Expand All @@ -98,6 +137,23 @@ public String getUserName() {
return this._username;
}

public void setAge(String age) {
this._age = age;
}

public String getAge() {
return this._age;
}

public void setImage(byte[] image){
this._image = image;
}

public byte[] getImage() {
return this._image;
}


public void setNumStars(int stars) {
this._numStars = stars;
}
Expand Down Expand Up @@ -136,11 +192,11 @@ public int getNumStars() {
public boolean isFinishLauncherTutorial() {return this._finishLauncherTutorial;}

public void setDisplayName(String name) {
_displayName = name;
this._displayName = name;
}

public String getDisplayName() {
return _displayName;
return this._displayName;
}

public void setOpenLibrary(boolean open) {
Expand Down Expand Up @@ -171,4 +227,11 @@ public boolean isOpenTools() {

public boolean isFinishWritingBoardTutorial() {return this._finishWritingBoardTutorial;}

public void setGamesClearedInTotal_L(int gamesClearedInTotal_L) {this._gamesClearedInTotal_L = gamesClearedInTotal_L; }

public int getGamesClearedInTotal_L() {return this._gamesClearedInTotal_L; }

public void setGamesClearedInTotal_M(int gamesClearedInTotal_M) {this._gamesClearedInTotal_M = gamesClearedInTotal_M; }

public int getGamesClearedInTotal_M() {return this._gamesClearedInTotal_M; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blueShade">#5067C0</color>
<color name="redShade">#D7145B</color>
</resources>
10 changes: 5 additions & 5 deletions launcher/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ android {
versionName "3.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
signingConfigs {

signingConfigs {
debug {
storeFile file('../debug.keystore')
SanchitTaliyan marked this conversation as resolved.
Show resolved Hide resolved
storePassword "android"
Expand All @@ -37,7 +37,7 @@ android {
}
}

productFlavors {
productFlavors {

englishUS {

Expand All @@ -47,7 +47,7 @@ android {

}
}

buildTypes {
release {
minifyEnabled false
Expand Down
Loading