Skip to content

Commit

Permalink
Merge pull request #21 from batshalregmi/UI
Browse files Browse the repository at this point in the history
UI
  • Loading branch information
patelshubh1022 authored Apr 3, 2024
2 parents cf73bb6 + 9968c16 commit bca10ff
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 7 deletions.
37 changes: 37 additions & 0 deletions app/src/main/java/com/group3/spotifywrapped/settingsActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.group3.spotifywrapped;
import androidx.appcompat.app.AppCompatActivity;

import android.app.Dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class settingsActivity extends AppCompatActivity {
Dialog myDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
myDialog = new Dialog(this);
}
// function that opens the custompopup.xml layout when the user clicks on the "Change Password" button
public void ShowPopup(View v) {
TextView txtclose;
Button btnFollow;
myDialog.setContentView(R.layout.custompopup);
txtclose =(TextView) myDialog.findViewById(R.id.txtclose);
txtclose.setText("X");
txtclose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
myDialog.dismiss();
}
});
myDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
myDialog.show();
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/circlebackground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="2dp" android:color="@color/black"/>
</shape>
46 changes: 39 additions & 7 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:orientation="vertical"
android:gravity="center"
android:background="#B7E1D7"
tools:context=".CoreAppViews.SettingsActivity">
tools:context=".settingsActivity">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="570dp"
Expand Down Expand Up @@ -38,28 +38,60 @@
android:textStyle="bold" />

<ImageView

android:layout_marginTop="5dp"
android:id="@+id/userProfilePicture"
android:layout_width="320dp"
android:layout_height="200dp"
android:layout_width="330dp"
android:layout_gravity="center"
tools:src="@tools:sample/avatars" />
android:layout_height="wrap_content"
tools:src="@tools:sample/avatars"
android:contentDescription="spotify profile picture" />

<TextView
android:layout_marginTop="5dp"
android:id="@+id/usernameUnderPicture"
android:layout_width="93dp"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center"
android:text="username" />
android:text="@string/username_spotify" />

<Button
android:id="@+id/link_to_spotify"
android:layout_width="wrap_content"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_gravity="center"
android:backgroundTint="@color/green"
android:text="Link Spotify Account" />
android:text="@string/link_spotify_account" />

<Button
android:id="@+id/unlink_spotify"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_gravity="center"
android:backgroundTint="@color/green"
android:text="@string/unlink_spotify_account" />

<Button
android:onClick="ShowPopup"
android:id="@+id/change_password"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_gravity="center"
android:backgroundTint="@color/green"
android:text="@string/change_password" />

<Button
android:id="@+id/delete_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_gravity="center"
android:backgroundTint="#FF0000"
android:text="@string/delete_account" />


</LinearLayout>
Expand Down
79 changes: 79 additions & 0 deletions app/src/main/res/layout/custompopup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="350dp"
android:layout_height="475dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#FFFFFF"
android:orientation="vertical"
android:padding="5dp"
android:layout_gravity="center">

<TextView
android:id="@+id/txtclose"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="end"
android:background="@drawable/circlebackground"
android:gravity="center"
android:text="X"
android:textColor="@color/black"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:padding="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/loginText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Change Password"
android:textAlignment="center"
android:textColor="@color/green"
android:textSize="30sp"
android:textStyle="bold" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passwordParent"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:textColor="@color/black"
app:cursorColor="@color/purple"
app:hintEnabled="false"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/green">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/newPassword"
android:layout_width="290dp"
android:layout_height="50dp"
android:background="@drawable/custom_edittext"
android:defaultFocusHighlightEnabled="false"
android:hint="New Password"
android:inputType="textPassword"
android:padding="8dp"
app:hintAnimationEnabled="false" />
</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="30dp"
android:backgroundTint="@color/green"
android:text="Submit"
android:textSize="18sp"
app:cornerRadius="20dp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="string_Settings">Settings</string>
<string name="username_spotify">username</string>
<string name="link_spotify_account">Link Spotify Account</string>
<string name="unlink_spotify_account">Unlink Spotify Account</string>
<string name="change_password">Change Password</string>
<string name="delete_account">Delete Account</string>
</resources>

0 comments on commit bca10ff

Please sign in to comment.