Skip to content

Commit

Permalink
updateDetailsFragment UI done
Browse files Browse the repository at this point in the history
  • Loading branch information
gargVader committed Aug 6, 2021
1 parent ef22adc commit 93d6d7a
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.codechefeventsapp.R;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.charts.PieChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.LimitLine;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
Expand Down Expand Up @@ -60,8 +61,8 @@ public class ProfileFragment extends Fragment {
private FirebaseAuth auth;
private FirebaseUser currentUser;

TextView nameTextView;
ImageView profileImageView;
TextView user_name;
ImageView user_image;
PieChart pieChart;
LineChart lineChart;

Expand All @@ -80,10 +81,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
signInLayout = view.findViewById(R.id.signInLayout);
profileLayout = view.findViewById(R.id.profileLayout);
signInButton = view.findViewById(R.id.signInButton);

pieChart = view.findViewById(R.id.piechart);
lineChart = view.findViewById(R.id.ratingGraph);
// nameTextView = view.findViewById(R.id.name_text_view);
// profileImageView = view.findViewById(R.id.profile_image_view);
user_name = view.findViewById(R.id.user_name);
user_image = view.findViewById(R.id.userImage);

initGoogleSign();
initProfileLayout();
Expand Down Expand Up @@ -152,12 +154,13 @@ void initProfileLayout() {
String email = currentUser.getEmail();
Uri photoUrl = currentUser.getPhotoUrl();
String uid = currentUser.getUid();
String photoUrlString= photoUrl.toString().replace("s96-c", "s400-c");

// nameTextView.setText(name);
// Glide.with(this)
// .load(String.valueOf(photoUrl))
// .apply(RequestOptions.circleCropTransform())
// .into(profileImageView);
user_name.setText(name);
Glide.with(this)
.load(photoUrlString)
.apply(RequestOptions.circleCropTransform())
.into(user_image);

initPieChart();
initRatingGraph();
Expand Down Expand Up @@ -212,7 +215,7 @@ void initPieChart() {
pieChart.getLegend().setDirection(Legend.LegendDirection.RIGHT_TO_LEFT);
}

void initRatingGraph(){
void initRatingGraph() {
// lineChart.setTouchEnabled(true);
// lineChart.setPinchZoom(true);
// LimitLine limitLine = new LimitLine(30f, "girishgarg");
Expand Down
Binary file added app/src/main/res/drawable/atcoder_icon.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/codechef_icon.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/codeforces_icon.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/hackerearth_icon.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/hackerrank_icon.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/spoj_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/src/main/res/layout/fragment_profile_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/name"
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_4sdp"
android:fontFamily="@font/inter_bold"
android:text="Girish Garg"
android:text="FirstName LastName"
android:textColor="@color/white"
android:textSize="@dimen/_13ssp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -49,7 +49,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_34sdp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name">
app:layout_constraintTop_toBottomOf="@id/user_name">

<include layout="@layout/user_number_of_problems_layout" />
</LinearLayout>
Expand Down
231 changes: 225 additions & 6 deletions app/src/main/res/layout/fragment_user_settings.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:background="@color/colorPrimary"
tools:context=".fragments.UserSettingsFragment">

<TextView
android:layout_width="wrap_content"
android:text="User Settings Fragment"
style="@style/textStyleMedium"
android:layout_height="wrap_content"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/_8sdp">

<TextView
style="@style/textStyleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_16sdp"
android:text="Update Handles"
android:textSize="@dimen/_16ssp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/codechef_icon"
app:tint="@color/white" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="CodeChef"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/codeforces_icon" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="Codeforces"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/atcoder_icon"
app:tint="@color/white" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="Atcoder"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/spoj_icon"
app:tint="@color/white" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="Spoj"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/hackerrank_icon" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="Hackerrank"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/hackerearth_icon"
app:tint="@color/white" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_4sdp"
android:text="Hackerearth"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/colorTextWhite" />

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="@dimen/_38sdp"
android:layout_marginStart="@dimen/_24sdp"
android:background="@drawable/background_search"
android:paddingHorizontal="8dp"
android:textColor="@color/white" />
</LinearLayout>

<Button
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_16sdp"
android:backgroundTint="@color/colorSecondary"
android:elevation="@dimen/_16sdp"
android:text="Save Changes"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</LinearLayout>


</ScrollView>
</FrameLayout>

0 comments on commit 93d6d7a

Please sign in to comment.