mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-26 16:04:07 +08:00
Update missing progress bars (#652)
update missing progress bars Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/652
This commit is contained in:
parent
7caff70946
commit
8768c87b8a
@ -52,6 +52,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
private List<Commits> commitsList;
|
private List<Commits> commitsList;
|
||||||
private CommitsAdapter adapter;
|
private CommitsAdapter adapter;
|
||||||
private ApiInterface api;
|
private ApiInterface api;
|
||||||
|
private ProgressBar progressLoadMore;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutResourceId() {
|
protected int getLayoutResourceId() {
|
||||||
@ -84,6 +85,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
|
|
||||||
ImageView closeActivity = findViewById(R.id.close);
|
ImageView closeActivity = findViewById(R.id.close);
|
||||||
noData = findViewById(R.id.noDataCommits);
|
noData = findViewById(R.id.noDataCommits);
|
||||||
|
progressLoadMore = findViewById(R.id.progressLoadMore);
|
||||||
progressBar = findViewById(R.id.progress_bar);
|
progressBar = findViewById(R.id.progress_bar);
|
||||||
SwipeRefreshLayout swipeRefresh = findViewById(R.id.pullToRefresh);
|
SwipeRefreshLayout swipeRefresh = findViewById(R.id.pullToRefresh);
|
||||||
|
|
||||||
@ -176,9 +178,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
|
|
||||||
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName, int resultLimit) {
|
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName, int resultLimit) {
|
||||||
|
|
||||||
//add loading progress view
|
progressLoadMore.setVisibility(View.VISIBLE);
|
||||||
commitsList.add(new Commits("load"));
|
|
||||||
adapter.notifyItemInserted((commitsList.size() - 1));
|
|
||||||
|
|
||||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName, resultLimit);
|
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName, resultLimit);
|
||||||
|
|
||||||
@ -189,9 +189,6 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
//remove loading view
|
|
||||||
commitsList.remove(commitsList.size() - 1);
|
|
||||||
|
|
||||||
List<Commits> result = response.body();
|
List<Commits> result = response.body();
|
||||||
|
|
||||||
assert result != null;
|
assert result != null;
|
||||||
@ -208,6 +205,7 @@ public class CommitsActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
|
progressLoadMore.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -53,6 +53,7 @@ public class RepoForksActivity extends BaseActivity {
|
|||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private List<UserRepositories> forksList;
|
private List<UserRepositories> forksList;
|
||||||
private RepoForksAdapter adapter;
|
private RepoForksAdapter adapter;
|
||||||
|
private ProgressBar progressLoadMore;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutResourceId() {
|
protected int getLayoutResourceId() {
|
||||||
@ -86,6 +87,7 @@ public class RepoForksActivity extends BaseActivity {
|
|||||||
|
|
||||||
ImageView closeActivity = findViewById(R.id.close);
|
ImageView closeActivity = findViewById(R.id.close);
|
||||||
noData = findViewById(R.id.noData);
|
noData = findViewById(R.id.noData);
|
||||||
|
progressLoadMore = findViewById(R.id.progressLoadMore);
|
||||||
progressBar = findViewById(R.id.progress_bar);
|
progressBar = findViewById(R.id.progress_bar);
|
||||||
SwipeRefreshLayout swipeRefresh = findViewById(R.id.pullToRefresh);
|
SwipeRefreshLayout swipeRefresh = findViewById(R.id.pullToRefresh);
|
||||||
|
|
||||||
@ -184,9 +186,7 @@ public class RepoForksActivity extends BaseActivity {
|
|||||||
|
|
||||||
private void loadMore(String instanceUrl, String instanceToken, String repoOwner, String repoName, int page, int resultLimit) {
|
private void loadMore(String instanceUrl, String instanceToken, String repoOwner, String repoName, int page, int resultLimit) {
|
||||||
|
|
||||||
//add loading progress view
|
progressLoadMore.setVisibility(View.VISIBLE);
|
||||||
forksList.add(new UserRepositories("load"));
|
|
||||||
adapter.notifyItemInserted((forksList.size() - 1));
|
|
||||||
|
|
||||||
Call<List<UserRepositories>> call = RetrofitClient
|
Call<List<UserRepositories>> call = RetrofitClient
|
||||||
.getInstance(instanceUrl, ctx)
|
.getInstance(instanceUrl, ctx)
|
||||||
@ -219,6 +219,7 @@ public class RepoForksActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
adapter.notifyDataChanged();
|
adapter.notifyDataChanged();
|
||||||
|
progressLoadMore.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/pullToRefresh"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="56dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
@ -68,6 +68,15 @@
|
|||||||
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.ProgressIndicator
|
||||||
|
android:id="@+id/progressLoadMore"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="56dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noDataCommits"
|
android:id="@+id/noDataCommits"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor">
|
android:background="?attr/primaryBackgroundColor">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/pullToRefresh"
|
android:id="@+id/pullToRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="56dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
@ -60,6 +60,23 @@
|
|||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.ProgressIndicator
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="56dp"
|
||||||
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.ProgressIndicator
|
||||||
|
android:id="@+id/progressLoadMore"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="56dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noData"
|
android:id="@+id/noData"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -71,13 +88,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progress_bar"
|
|
||||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -52,6 +53,13 @@
|
|||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.ProgressIndicator
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noDataStargazers"
|
android:id="@+id/noDataStargazers"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -62,12 +70,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progress_bar"
|
|
||||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -52,6 +53,13 @@
|
|||||||
android:background="?attr/primaryBackgroundColor"
|
android:background="?attr/primaryBackgroundColor"
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.ProgressIndicator
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
|
||||||
|
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/noDataWatchers"
|
android:id="@+id/noDataWatchers"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -62,12 +70,4 @@
|
|||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progress_bar"
|
|
||||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user