Improve layouts #524
|
@ -77,16 +77,20 @@ public class MilestonesFragment extends Fragment {
|
|||
dataList = new ArrayList<>();
|
||||
adapter = new MilestonesAdapter(ctx, dataList);
|
||||
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
|
||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, tinyDb.getString("milestoneState"));
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
|
||||
}
|
||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, tinyDb.getString("milestoneState"));
|
||||
|
||||
}));
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
viewBinding.recyclerView.setHasFixedSize(true);
|
||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
@ -113,16 +117,21 @@ public class MilestonesFragment extends Fragment {
|
|||
dataList.clear();
|
||||
|
||||
adapter = new MilestonesAdapter(ctx, dataList);
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, milestoneState);
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
|
||||
}
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
|
||||
}));
|
||||
int page = (dataList.size() + resultLimit) / resultLimit;
|
||||
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, milestoneState);
|
||||
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
tinyDb.putString("milestoneState", milestoneState);
|
||||
|
||||
|
@ -171,7 +180,7 @@ public class MilestonesFragment extends Fragment {
|
|||
@Override
|
||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert response.body() != null;
|
||||
if(response.body().size() > 0) {
|
||||
|
@ -222,7 +231,7 @@ public class MilestonesFragment extends Fragment {
|
|||
@Override
|
||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
//remove loading view
|
||||
dataList.remove(dataList.size() - 1);
|
||||
|
@ -238,7 +247,6 @@ public class MilestonesFragment extends Fragment {
|
|||
}
|
||||
else {
|
||||
|
||||
Toasty.info(ctx, getString(R.string.noMoreData));
|
||||
adapter.setMoreDataAvailable(false);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
<GridView
|
||||
|
@ -50,4 +49,4 @@
|
|||
android:indeterminate="true"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -54,4 +53,4 @@
|
|||
android:visibility="gone"
|
||||
android:contentDescription="@string/addNewContent" />
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:id="@+id/milestoneFrame"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
@ -21,119 +20,136 @@
|
|||
android:id="@+id/milestoneStatus" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameTitle"
|
||||
android:id="@+id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneTitle"
|
||||
android:layout_width="0dp"
|
||||
android:textIsSelectable="true"
|
||||
<LinearLayout
|
||||
android:id="@+id/frameTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".80"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestoneState"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".15"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:contentDescription="@string/pageTitleCreateMilestone"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoDescription"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesClosed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoWatchers"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/milestoneProgress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="80"
|
||||
android:progress="50"
|
||||
android:layout_marginTop="2dp"
|
||||
android:progressDrawable="@drawable/progress_bar"
|
||||
android:progressTint="@color/colorLightGreen" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesOpen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoStars"
|
||||
android:gravity="end"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/milestoneDateMenuFrame"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".90"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/dueDateFrame"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="3dp">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDueDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/milestoneTitle"
|
||||
android:layout_width="0dp"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dueDate"
|
||||
android:layout_weight=".80"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestoneState"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".15"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:contentDescription="@string/pageTitleCreateMilestone"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoDescription"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesClosed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoWatchers"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
<ProgressBar
|
||||
android:id="@+id/milestoneProgress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="80"
|
||||
android:progress="50"
|
||||
android:layout_marginTop="2dp"
|
||||
android:progressDrawable="@drawable/progress_bar"
|
||||
android:progressTint="@color/colorLightGreen" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestonesMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".10"
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesOpen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoStars"
|
||||
android:gravity="end"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/ic_dotted_menu_horizontal"
|
||||
android:contentDescription="@string/menuContentDesc" />
|
||||
android:id="@+id/milestoneDateMenuFrame"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".90"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/dueDateFrame"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDueDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dueDate"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestonesMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".10"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/ic_dotted_menu_horizontal"
|
||||
android:contentDescription="@string/menuContentDesc" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_below="@id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
Reference in New Issue
Block a user