Skip to content

Commit

Permalink
fix: revamp of community page ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince Raj authored and PratyushSingh07 committed Dec 16, 2023
1 parent 1942273 commit b8593e3
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 127 deletions.
81 changes: 38 additions & 43 deletions app/src/main/res/layout/fragment_community.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.fragment.CommunityFragment">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/backgroundColor"
>
android:orientation="vertical">

<ImageView
android:id="@+id/bg_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_img"
android:importantForAccessibility="no"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
Expand All @@ -21,62 +31,47 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbarDashboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dark_green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">


</com.google.android.material.appbar.MaterialToolbar>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbarDashboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dark_green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="Community" />
</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
android:id="@+id/llHealthImg"
android:orientation="vertical"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_community_name"
android:layout_width="match_parent"
android:layout_height="200sp"
android:background="@drawable/background_img"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@+id/appBarLayout" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_community_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_community_member"
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingTop="32dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_community_name"
tools:listitem="@layout/user_community_member_list" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="20dp"
android:backgroundTint="@color/dark_green"
android:contentDescription="Add post to community"
android:src="@drawable/ic_baseline_add_24"
app:tint = "@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_margin="20dp"/>


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_community_member"
android:layout_width="match_parent"
android:layout_height="0sp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llHealthImg"
tools:layout_editor_absoluteX="4dp"
tools:listitem="@layout/user_community_member_list" />


app:tint="@color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>




</FrameLayout>
66 changes: 26 additions & 40 deletions app/src/main/res/layout/item_community_list.xml
Original file line number Diff line number Diff line change
@@ -1,53 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_community"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="60dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:id="@+id/ll_community"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

<ImageView
android:id="@+id/communityPic"
android:layout_width="200sp"
android:layout_height="100sp"
android:scaleType="fitXY"
android:src="@drawable/bottom_banner"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/roundedImageView" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Community"
android:textColor="@color/white"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

android:orientation="vertical">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/communityPic"
android:layout_width="200dp"
android:layout_height="100dp"
android:importantForAccessibility="no"
android:scaleType="fitXY"
android:src="@drawable/bottom_banner"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/roundedImageView" />

<TextView
android:id="@+id/communityName"
android:layout_width="match_parent"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/textColor"
android:textAlignment="center"
android:textSize="16sp"
/>



android:textColor="@color/white"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
74 changes: 30 additions & 44 deletions app/src/main/res/layout/user_community_member_list.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="4sp"
app:cardCornerRadius="6sp"
app:cardElevation="10sp"
android:layout_margin="8dp"
android:outlineSpotShadowColor="@color/dark_green"
>
app:cardCornerRadius="8dp"
app:cardElevation="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8sp"
android:orientation="vertical"
android:gravity="end"
>
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8sp"
android:orientation="horizontal"
android:layout_margin="4dp"
android:gravity="center_vertical"
>
android:orientation="horizontal">

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/iv_post_user"
android:layout_width="20sp"
android:layout_height="20sp"
android:src="@drawable/profile_icon"
/>
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/profile_icon" />

<TextView
android:id="@+id/tv_post_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginStart="4dp"
android:text="Aditya Gupta"
android:textSize="16sp"
android:layout_marginStart="20sp"
/>

android:textColor="@color/black"
android:textSize="14sp" />
</LinearLayout>

<LinearLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">

<TextView
android:id="@+id/tv_post_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8sp"
android:orientation="vertical"
android:gravity="center"
>

<ImageView
android:id="@+id/iv_post_image"
android:layout_width="100sp"
android:layout_height="100sp"
/>

<TextView
android:id="@+id/tv_post_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="20sp"
/>


</LinearLayout>
android:layout_margin="4dp"
android:textSize="16sp" />

<ImageView
android:id="@+id/iv_post_image"
android:layout_width="match_parent"
android:layout_height="200dp"
android:contentDescription="community post image"
android:scaleType="centerInside" />
</LinearLayout>
</LinearLayout>


</androidx.cardview.widget.CardView>

0 comments on commit b8593e3

Please sign in to comment.