Org ui revamp

This commit is contained in:
M M Arif
2022-08-12 10:10:57 +05:00
parent 186f0e80c1
commit 83b3e84b81
3 changed files with 65 additions and 47 deletions

View File

@@ -12,18 +12,15 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateOrganizationActivity;
import org.mian.gitnex.activities.MainActivity;
import org.mian.gitnex.adapters.OrganizationsListAdapter;
import org.mian.gitnex.databinding.FragmentOrganizationsBinding;
import org.mian.gitnex.helpers.Constants;
import org.mian.gitnex.helpers.DividerItemDecorator;
import org.mian.gitnex.viewmodels.OrganizationsViewModel;
/**
@@ -58,9 +55,6 @@ public class OrganizationsFragment extends Fragment {
fragmentOrganizationsBinding.recyclerView.setHasFixedSize(true);
fragmentOrganizationsBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.shape_list_divider));
fragmentOrganizationsBinding.recyclerView.addItemDecoration(dividerItemDecoration);
fragmentOrganizationsBinding.recyclerView.setPadding(0, 0, 0, 240);
fragmentOrganizationsBinding.recyclerView.setClipToPadding(false);

View File

@@ -5,19 +5,25 @@
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:padding="@dimen/dimen8dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:scrollbars="vertical" />
android:layout_height="wrap_content">
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"

View File

@@ -1,49 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/linearLayoutFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:orientation="vertical"
android:padding="16dp">
android:paddingTop="@dimen/dimen4dp"
android:paddingBottom="@dimen/dimen4dp">
<LinearLayout
android:id="@+id/orgInfoFrame"
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
style="?attr/materialCardViewFilledStyle"
app:cardElevation="@dimen/dimen0dp">
<ImageView
android:id="@+id/imageAvatar"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="10dp"
android:contentDescription="@string/repoContentAvatar"
android:src="@drawable/ic_android" />
<TextView
android:id="@+id/orgName"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="@string/orgName" />
android:foreground="?android:attr/selectableItemBackground"
android:background="?attr/materialCardBackgroundColor"
android:padding="@dimen/dimen12dp"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/orgInfoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="@+id/orgDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/noDataDescription"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:layout_marginTop="8dp"
android:textSize="15sp" />
<ImageView
android:id="@+id/imageAvatar"
android:layout_width="@dimen/dimen24dp"
android:layout_height="@dimen/dimen24dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="10dp"
android:contentDescription="@string/repoContentAvatar"
android:src="@drawable/ic_android" />
<TextView
android:id="@+id/orgName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="@string/orgName" />
</LinearLayout>
<TextView
android:id="@+id/orgDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/noDataDescription"
android:textColor="?attr/primaryTextColor"
android:visibility="gone"
android:layout_marginTop="8dp"
android:textSize="15sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>