Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:$rootProject.supportLibVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion"
testImplementation "junit:junit:$rootProject.junitVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation "junit:junit:$rootProject.junitVersion"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

Expand All @@ -66,6 +67,7 @@ dependencies {
implementation "com.android.support:support-v4:$rootProject.supportLibVersion"

implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.afollestad.material-dialogs:core:0.9.6.0"

// Firebase dependencies
implementation "com.google.firebase:firebase-core:15.0.2"
Expand Down
13 changes: 9 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
tools:replace="android:allowBackup"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
<activity android:name=".ui.signin.SignInActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -26,8 +26,11 @@
</intent-filter>
</activity>
<activity android:name=".ui.home.HomeActivity">
<!--Adding this intent filter here to silence the warning ,this should be a part of home
activity or quiz details activity-->

<!--
Adding this intent filter here to silence the warning ,this should be a part of home
activity or quiz details activity
-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
Expand Down Expand Up @@ -64,6 +67,8 @@
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />

<activity android:name=".ui.avatar.avatar_selection"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public interface DataHandler {
*/
String getStatus();

void setUserInfo(Callback<Void> callback);
//void setUserInfo(Callback<Void> callback);

void addNotification(Notification notification);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by dell on 4/21/2018.
*/

class NotificationContract {
public class NotificationContract {

private NotificationContract() {
// To prevent accidental instantiation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
package com.developervishalsehgal.udacityscholarsapp.ui.avatar;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.developervishalsehgal.udacityscholarsapp.R;

public class avatar_selection extends AppCompatActivity implements View.OnClickListener{

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_avatar_selection);
}

@Override
public void onClick(View view) {

final Intent intent = new Intent(this, com.developervishalsehgal.udacityscholarsapp.ui.profile.UserProfileActivity.class);

int id = view.getId();
switch (id) {

case R.id.pic1:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_1);
startActivity(intent);
}
})
.show();

break;

case R.id.pic2:
new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_2);
startActivity(intent);
}
})
.show();
break;

case R.id.pic3:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_3);
startActivity(intent);
}
})
.show();
break;

case R.id.pic4:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_8);
startActivity(intent);
}
})
.show();
break;

case R.id.pic5:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_5);
startActivity(intent);
}
})
.show();
break;

case R.id.pic6:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_6);
startActivity(intent);
}
})
.show();
break;

case R.id.pic7:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_7);
startActivity(intent);
}
})
.show();
break;

case R.id.pic8:

new MaterialDialog.Builder(this)
.title("Are you sure?")
.content("Selected image would be chosen as your new profile picture")
.positiveText("YES")
.negativeText("NO")
.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
intent.putExtra("profile_path", R.drawable.avatar_4);
startActivity(intent);
}
})
.show();
break;
default:
break;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void initializeUI() {

mImgUserPic = findViewById(R.id.img_user_pic);
mEtSlackHandle = findViewById(R.id.tiet_slack_handle);
mEtCourseTrack = findViewById(R.id.et_scholarship_track);
Expand Down Expand Up @@ -146,6 +147,9 @@ public void onClick(View v) {
mPresenter.saveProfile("", mEtSlackHandle.getText().toString()
, mEtCourseTrack.getText().toString());
break;
case R.id.img_user_pic:
Intent intent = new Intent(this,com.developervishalsehgal.udacityscholarsapp.ui.avatar.avatar_selection.class);
startActivity(intent);
default:
break;
}
Expand Down
Binary file added app/src/main/res/drawable-hdpi/avatar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/avatar_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/avatar_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/avatar_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/avatar_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/avatar_2.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_3.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_4.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_5.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_6.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_7.png
Binary file added app/src/main/res/drawable-xxhdpi/avatar_8.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_1.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_2.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_3.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_4.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_5.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_6.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_7.png
Binary file added app/src/main/res/drawable-xxxhdpi/avatar_8.png
104 changes: 104 additions & 0 deletions app/src/main/res/layout/activity_avatar_selection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.developervishalsehgal.udacityscholarsapp.ui.avatar.avatar_selection">

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">

<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:rowCount="4"
android:columnCount="2"
android:background="@color/colorPrimaryDark">

<ImageView
android:id="@+id/pic1"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_1"
android:onClick="onClick"
android:padding="2dp" />

<ImageView
android:id="@+id/pic2"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_2"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic3"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_3"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic4"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_8"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic5"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_5"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic6"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_6"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic7"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_7"
android:onClick="onClick"
android:padding="2dp"/>

<ImageView
android:id="@+id/pic8"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_columnWeight="1"
android:layout_gravity="fill_horizontal"
android:src="@drawable/avatar_4"
android:onClick="onClick"
android:padding="2dp"/>
</GridLayout>

</ScrollView>

</android.support.constraint.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_user_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view"
app:layout_constraintVertical_bias="0.107"
tools:src="@drawable/akshit" />
tools:src="@drawable/akshit"/>

<EditText
android:id="@+id/et_user_name"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<color name="white">#ffffff</color>
<color name="darkgrey">#6c6c6c</color>
<color name="black">#000000</color>
<color name="transparent">#0000000</color>
<color name="bg">#283747</color>
<color name="red">#EC7063</color>

Expand Down