mirror of https://codeberg.org/gitnex/GitNex.git
Fix link to APK builds, add search to repo watchers and stargazors
This commit is contained in:
parent
0b5a201530
commit
51b90310d7
|
@ -12,7 +12,7 @@ GitNex is licensed under the GPLv3 License. Please refer to the LICENSE file for
|
||||||
|
|
||||||
[<img alt='Get it on F-Droid' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/fdroid.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
|
[<img alt='Get it on F-Droid' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/fdroid.png' height="80"/>](https://f-droid.org/en/packages/org.mian.gitnex/)
|
||||||
[<img alt='Get it on Google Play' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/google-play.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
|
[<img alt='Get it on Google Play' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/google-play.png' height="80"/>](https://play.google.com/store/apps/details?id=org.mian.gitnex.pro)
|
||||||
[<img alt='Download builds and releases' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/DN7E5xxtaw4fRbE)
|
[<img alt='Download builds and releases' src='https://codeberg.org/gitnex/GitNex/raw/branch/main/assets/apk-badge.png' height="82"/>](https://cloud.swatian.com/s/WS4k3seXnmfQppo)
|
||||||
|
|
||||||
## Note about Forgejo and Gitea version
|
## Note about Forgejo and Gitea version
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
package org.mian.gitnex.activities;
|
package org.mian.gitnex.activities;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.GridView;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ImageView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.UserGridAdapter;
|
import org.mian.gitnex.adapters.UserGridAdapter;
|
||||||
import org.mian.gitnex.databinding.ActivityRepoStargazersBinding;
|
import org.mian.gitnex.databinding.ActivityRepoStargazersBinding;
|
||||||
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||||
import org.mian.gitnex.viewmodels.RepoStargazersViewModel;
|
import org.mian.gitnex.viewmodels.RepoStargazersViewModel;
|
||||||
|
|
||||||
|
@ -18,37 +22,30 @@ import org.mian.gitnex.viewmodels.RepoStargazersViewModel;
|
||||||
*/
|
*/
|
||||||
public class RepoStargazersActivity extends BaseActivity {
|
public class RepoStargazersActivity extends BaseActivity {
|
||||||
|
|
||||||
private TextView noDataStargazers;
|
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
private UserGridAdapter adapter;
|
private UserGridAdapter adapter;
|
||||||
private GridView mGridView;
|
private Boolean searchFilter = false;
|
||||||
private ProgressBar mProgressBar;
|
|
||||||
|
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
|
private ActivityRepoStargazersBinding activityRepoStargazersBinding;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
ActivityRepoStargazersBinding activityRepoStargazersBinding =
|
activityRepoStargazersBinding = ActivityRepoStargazersBinding.inflate(getLayoutInflater());
|
||||||
ActivityRepoStargazersBinding.inflate(getLayoutInflater());
|
|
||||||
setContentView(activityRepoStargazersBinding.getRoot());
|
setContentView(activityRepoStargazersBinding.getRoot());
|
||||||
|
|
||||||
ImageView closeActivity = activityRepoStargazersBinding.close;
|
setSupportActionBar(activityRepoStargazersBinding.toolbar);
|
||||||
TextView toolbarTitle = activityRepoStargazersBinding.toolbarTitle;
|
|
||||||
noDataStargazers = activityRepoStargazersBinding.noDataStargazers;
|
|
||||||
mGridView = activityRepoStargazersBinding.gridView;
|
|
||||||
mProgressBar = activityRepoStargazersBinding.progressBar;
|
|
||||||
|
|
||||||
repository = RepositoryContext.fromIntent(getIntent());
|
repository = RepositoryContext.fromIntent(getIntent());
|
||||||
final String repoOwner = repository.getOwner();
|
final String repoOwner = repository.getOwner();
|
||||||
final String repoName = repository.getName();
|
final String repoName = repository.getName();
|
||||||
|
|
||||||
initCloseListener();
|
initCloseListener();
|
||||||
closeActivity.setOnClickListener(onClickListener);
|
activityRepoStargazersBinding.close.setOnClickListener(onClickListener);
|
||||||
|
|
||||||
toolbarTitle.setText(R.string.repoStargazersInMenu);
|
activityRepoStargazersBinding.toolbarTitle.setText(R.string.repoStargazersInMenu);
|
||||||
|
|
||||||
fetchDataAsync(repoOwner, repoName);
|
fetchDataAsync(repoOwner, repoName);
|
||||||
}
|
}
|
||||||
|
@ -67,16 +64,19 @@ public class RepoStargazersActivity extends BaseActivity {
|
||||||
|
|
||||||
if (adapter.getCount() > 0) {
|
if (adapter.getCount() > 0) {
|
||||||
|
|
||||||
mGridView.setAdapter(adapter);
|
activityRepoStargazersBinding.gridView.setAdapter(adapter);
|
||||||
noDataStargazers.setVisibility(View.GONE);
|
activityRepoStargazersBinding.noDataStargazers.setVisibility(
|
||||||
|
View.GONE);
|
||||||
|
searchFilter = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
mGridView.setAdapter(adapter);
|
activityRepoStargazersBinding.gridView.setAdapter(adapter);
|
||||||
noDataStargazers.setVisibility(View.VISIBLE);
|
activityRepoStargazersBinding.noDataStargazers.setVisibility(
|
||||||
|
View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
activityRepoStargazersBinding.progressBar.setVisibility(View.GONE);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,4 +90,49 @@ public class RepoStargazersActivity extends BaseActivity {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
repository.checkAccountSwitch(this);
|
repository.checkAccountSwitch(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||||
|
|
||||||
|
final MenuInflater inflater = getMenuInflater();
|
||||||
|
|
||||||
|
new Handler(Looper.getMainLooper())
|
||||||
|
.postDelayed(
|
||||||
|
() -> {
|
||||||
|
if (searchFilter) {
|
||||||
|
|
||||||
|
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||||
|
|
||||||
|
inflater.inflate(R.menu.search_menu, menu);
|
||||||
|
|
||||||
|
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||||
|
SearchView searchView = (SearchView) searchItem.getActionView();
|
||||||
|
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
|
||||||
|
if (!connToInternet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
searchView.setOnQueryTextListener(
|
||||||
|
new androidx.appcompat.widget.SearchView
|
||||||
|
.OnQueryTextListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
|
||||||
|
adapter.getFilter().filter(newText);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
500);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
package org.mian.gitnex.activities;
|
package org.mian.gitnex.activities;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.GridView;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ImageView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.UserGridAdapter;
|
import org.mian.gitnex.adapters.UserGridAdapter;
|
||||||
import org.mian.gitnex.databinding.ActivityRepoWatchersBinding;
|
import org.mian.gitnex.databinding.ActivityRepoWatchersBinding;
|
||||||
|
import org.mian.gitnex.helpers.AppUtil;
|
||||||
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
import org.mian.gitnex.helpers.contexts.RepositoryContext;
|
||||||
import org.mian.gitnex.viewmodels.RepoWatchersViewModel;
|
import org.mian.gitnex.viewmodels.RepoWatchersViewModel;
|
||||||
|
|
||||||
|
@ -18,12 +22,10 @@ import org.mian.gitnex.viewmodels.RepoWatchersViewModel;
|
||||||
*/
|
*/
|
||||||
public class RepoWatchersActivity extends BaseActivity {
|
public class RepoWatchersActivity extends BaseActivity {
|
||||||
|
|
||||||
private TextView noDataWatchers;
|
|
||||||
private View.OnClickListener onClickListener;
|
private View.OnClickListener onClickListener;
|
||||||
private UserGridAdapter adapter;
|
private UserGridAdapter adapter;
|
||||||
private GridView mGridView;
|
private Boolean searchFilter = false;
|
||||||
private ProgressBar mProgressBar;
|
private ActivityRepoWatchersBinding activityRepoWatchersBinding;
|
||||||
|
|
||||||
private RepositoryContext repository;
|
private RepositoryContext repository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,24 +33,19 @@ public class RepoWatchersActivity extends BaseActivity {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
ActivityRepoWatchersBinding activityRepoWatchersBinding =
|
activityRepoWatchersBinding = ActivityRepoWatchersBinding.inflate(getLayoutInflater());
|
||||||
ActivityRepoWatchersBinding.inflate(getLayoutInflater());
|
|
||||||
setContentView(activityRepoWatchersBinding.getRoot());
|
setContentView(activityRepoWatchersBinding.getRoot());
|
||||||
|
|
||||||
ImageView closeActivity = activityRepoWatchersBinding.close;
|
setSupportActionBar(activityRepoWatchersBinding.toolbar);
|
||||||
TextView toolbarTitle = activityRepoWatchersBinding.toolbarTitle;
|
|
||||||
noDataWatchers = activityRepoWatchersBinding.noDataWatchers;
|
|
||||||
mGridView = activityRepoWatchersBinding.gridView;
|
|
||||||
mProgressBar = activityRepoWatchersBinding.progressBar;
|
|
||||||
|
|
||||||
repository = RepositoryContext.fromIntent(getIntent());
|
repository = RepositoryContext.fromIntent(getIntent());
|
||||||
final String repoOwner = repository.getOwner();
|
final String repoOwner = repository.getOwner();
|
||||||
final String repoName = repository.getName();
|
final String repoName = repository.getName();
|
||||||
|
|
||||||
initCloseListener();
|
initCloseListener();
|
||||||
closeActivity.setOnClickListener(onClickListener);
|
activityRepoWatchersBinding.close.setOnClickListener(onClickListener);
|
||||||
|
|
||||||
toolbarTitle.setText(R.string.repoWatchersInMenu);
|
activityRepoWatchersBinding.toolbarTitle.setText(R.string.repoWatchersInMenu);
|
||||||
|
|
||||||
fetchDataAsync(repoOwner, repoName);
|
fetchDataAsync(repoOwner, repoName);
|
||||||
}
|
}
|
||||||
|
@ -67,16 +64,18 @@ public class RepoWatchersActivity extends BaseActivity {
|
||||||
|
|
||||||
if (adapter.getCount() > 0) {
|
if (adapter.getCount() > 0) {
|
||||||
|
|
||||||
mGridView.setAdapter(adapter);
|
activityRepoWatchersBinding.gridView.setAdapter(adapter);
|
||||||
noDataWatchers.setVisibility(View.GONE);
|
activityRepoWatchersBinding.noDataWatchers.setVisibility(View.GONE);
|
||||||
|
searchFilter = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
mGridView.setAdapter(adapter);
|
activityRepoWatchersBinding.gridView.setAdapter(adapter);
|
||||||
noDataWatchers.setVisibility(View.VISIBLE);
|
activityRepoWatchersBinding.noDataWatchers.setVisibility(
|
||||||
|
View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
activityRepoWatchersBinding.progressBar.setVisibility(View.GONE);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,4 +89,49 @@ public class RepoWatchersActivity extends BaseActivity {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
repository.checkAccountSwitch(this);
|
repository.checkAccountSwitch(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||||
|
|
||||||
|
final MenuInflater inflater = getMenuInflater();
|
||||||
|
|
||||||
|
new Handler(Looper.getMainLooper())
|
||||||
|
.postDelayed(
|
||||||
|
() -> {
|
||||||
|
if (searchFilter) {
|
||||||
|
|
||||||
|
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||||
|
|
||||||
|
inflater.inflate(R.menu.search_menu, menu);
|
||||||
|
|
||||||
|
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||||
|
SearchView searchView = (SearchView) searchItem.getActionView();
|
||||||
|
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
|
||||||
|
if (!connToInternet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
searchView.setOnQueryTextListener(
|
||||||
|
new androidx.appcompat.widget.SearchView
|
||||||
|
.OnQueryTextListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
|
||||||
|
adapter.getFilter().filter(newText);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
500);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,10 +298,10 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||||
context.getResources().getColor(R.color.colorWhite, null)));
|
context.getResources().getColor(R.color.colorWhite, null)));
|
||||||
this.issuePrState.setBackgroundResource(R.drawable.shape_draft_release);
|
this.issuePrState.setBackgroundResource(R.drawable.shape_draft_release);
|
||||||
this.issuePrState.setPadding(
|
this.issuePrState.setPadding(
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen8dp),
|
(int) context.getResources().getDimension(R.dimen.dimen4dp),
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen2dp),
|
(int) context.getResources().getDimension(R.dimen.dimen0dp),
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen8dp),
|
(int) context.getResources().getDimension(R.dimen.dimen4dp),
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen2dp));
|
(int) context.getResources().getDimension(R.dimen.dimen0dp));
|
||||||
this.prTitle.setPadding(
|
this.prTitle.setPadding(
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen16dp),
|
(int) context.getResources().getDimension(R.dimen.dimen16dp),
|
||||||
(int) context.getResources().getDimension(R.dimen.dimen0dp),
|
(int) context.getResources().getDimension(R.dimen.dimen0dp),
|
||||||
|
|
|
@ -62,12 +62,10 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/issuePrState"
|
android:id="@+id/issuePrState"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dimen26dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/dimen26dp"
|
||||||
android:contentDescription="@string/generalImgContentText"
|
android:contentDescription="@string/generalImgContentText"
|
||||||
android:paddingStart="@dimen/dimen0dp"
|
android:src="@drawable/ic_draft"
|
||||||
android:paddingEnd="@dimen/dimen8dp"
|
|
||||||
android:src="@drawable/ic_issue"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
Loading…
Reference in New Issue