Merge pull request 'Repository Commits' (#308) from 13-repo-commits into master

Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/308
Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
M M Arif 2020-03-31 05:11:33 +00:00
commit 0f9025f925
92 changed files with 1219 additions and 126 deletions

View File

@ -90,5 +90,6 @@ Open source libraries
- Caverock/androidsvg
- Droidsonroids.gif/android-gif-drawable
- Barteksc/AndroidPdfViewer
- Mikepenz/fastadapter
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)

View File

@ -33,14 +33,15 @@ configurations {
dependencies {
def lifecycle_version = "2.2.0"
final def markwon_version = '4.2.1'
def markwon_version = "4.2.1"
def fastadapter = "3.3.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "com.google.android.material:material:1.2.0-alpha05"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
testImplementation 'junit:junit:4.13'
testImplementation "junit:junit:4.13"
androidTestImplementation "androidx.test:runner:1.2.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
implementation "com.github.vihtarb:tooltip:0.2.0"
@ -79,4 +80,8 @@ dependencies {
implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation "com.pddstudio:highlightjs-android:1.5.0"
implementation "com.github.barteksc:android-pdf-viewer:3.2.0-beta.1"
//noinspection GradleDependency
implementation "com.mikepenz:fastadapter:$fastadapter"
implementation "com.mikepenz:fastadapter-commons:$fastadapter"
implementation "com.mikepenz:fastadapter-extensions:$fastadapter"
}

View File

@ -73,6 +73,7 @@
<activity android:name=".activities.CreateOrganizationActivity" />
<activity android:name=".activities.OpenRepoInBrowserActivity" />
<activity android:name=".activities.FileDiffActivity" />
<activity android:name=".activities.CommitsActivity" />
</application>
</manifest>

View File

@ -0,0 +1,325 @@
package org.mian.gitnex.activities;
import android.os.Bundle;
import android.os.Handler;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.mikepenz.fastadapter.IItemAdapter;
import com.mikepenz.fastadapter.adapters.ItemAdapter;
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter;
import com.mikepenz.fastadapter.listeners.ItemFilterListener;
import com.mikepenz.fastadapter_extensions.items.ProgressItem;
import com.mikepenz.fastadapter_extensions.scroll.EndlessRecyclerOnScrollListener;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.items.CommitsItems;
import org.mian.gitnex.models.Commits;
import org.mian.gitnex.util.TinyDB;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static com.mikepenz.fastadapter.adapters.ItemAdapter.items;
/**
* Author M M Arif
*/
public class CommitsActivity extends BaseActivity implements ItemFilterListener<CommitsItems> {
private View.OnClickListener onClickListener;
private TextView noData;
private ProgressBar progressBar;
private SwipeRefreshLayout swipeRefreshLayout;
private String TAG = "CommitsActivity - ";
private int resultLimit = 50;
private boolean loadNextFlag = false;
private List<CommitsItems> items = new ArrayList<>();
private FastItemAdapter<CommitsItems> fastItemAdapter;
private ItemAdapter footerAdapter;
private EndlessRecyclerOnScrollListener endlessRecyclerOnScrollListener;
@Override
protected int getLayoutResourceId(){
return R.layout.activity_commits;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
TinyDB tinyDb = new TinyDB(getApplicationContext());
final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid");
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
final String repoName = parts[1];
String branchName = getIntent().getStringExtra("branchName");
TextView toolbar_title = findViewById(R.id.toolbar_title);
toolbar_title.setMovementMethod(new ScrollingMovementMethod());
toolbar_title.setText(branchName);
ImageView closeActivity = findViewById(R.id.close);
noData = findViewById(R.id.noDataCommits);
progressBar = findViewById(R.id.progress_bar);
swipeRefreshLayout = findViewById(R.id.pullToRefresh);
RecyclerView recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
recyclerView.setHasFixedSize(true);
initCloseListener();
closeActivity.setOnClickListener(onClickListener);
fastItemAdapter = new FastItemAdapter<>();
fastItemAdapter.withSelectable(true);
footerAdapter = items();
//noinspection unchecked
fastItemAdapter.addAdapter(1, footerAdapter);
fastItemAdapter.getItemFilter().withFilterPredicate((IItemAdapter.Predicate<CommitsItems>) (item, constraint) -> item.getCommitTitle().toLowerCase().contains(Objects.requireNonNull(constraint).toString().toLowerCase()));
fastItemAdapter.getItemFilter().withItemFilterListener(this);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(fastItemAdapter);
endlessRecyclerOnScrollListener = new EndlessRecyclerOnScrollListener(footerAdapter) {
@Override
public void onLoadMore(final int currentPage) {
loadNext(instanceUrl, instanceToken, repoOwner, repoName, currentPage, branchName);
}
};
swipeRefreshLayout.setOnRefreshListener(() -> {
progressBar.setVisibility(View.VISIBLE);
fastItemAdapter.clear();
endlessRecyclerOnScrollListener.resetPageCount();
swipeRefreshLayout.setRefreshing(false);
});
recyclerView.addOnScrollListener(endlessRecyclerOnScrollListener);
loadInitial(instanceUrl, instanceToken, repoOwner, repoName, branchName);
assert savedInstanceState != null;
fastItemAdapter.withSavedInstanceState(savedInstanceState);
}
private void loadInitial(String instanceUrl, String token, String repoOwner, String repoName, String branchName) {
Call<List<Commits>> call = RetrofitClient
.getInstance(instanceUrl, getApplicationContext())
.getApiInterface()
.getRepositoryCommits(token, repoOwner, repoName, 1, branchName);
call.enqueue(new Callback<List<Commits>>() {
@Override
public void onResponse(@NonNull Call<List<Commits>> call, @NonNull Response<List<Commits>> response) {
if (response.isSuccessful()) {
assert response.body() != null;
if(response.body().size() > 0) {
if(response.body().size() == resultLimit) {
loadNextFlag = true;
}
for (int i = 0; i < response.body().size(); i++) {
items.add(new CommitsItems(getApplicationContext()).withNewItems(response.body().get(i).getCommit().getMessage(), response.body().get(i).getHtml_url(),
response.body().get(i).getCommit().getCommitter().getName(), response.body().get(i).getCommit().getCommitter().getDate()));
}
fastItemAdapter.add(items);
}
else {
noData.setVisibility(View.VISIBLE);
}
progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<Commits>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}
private void loadNext(String instanceUrl, String token, String repoOwner, String repoName, final int currentPage, String branchName) {
footerAdapter.clear();
//noinspection unchecked
footerAdapter.add(new ProgressItem().withEnabled(false));
Handler handler = new Handler();
handler.postDelayed(() -> {
Call<List<Commits>> call = RetrofitClient
.getInstance(instanceUrl, getApplicationContext())
.getApiInterface()
.getRepositoryCommits(token, repoOwner, repoName, currentPage + 1, branchName);
call.enqueue(new Callback<List<Commits>>() {
@Override
public void onResponse(@NonNull Call<List<Commits>> call, @NonNull Response<List<Commits>> response) {
if (response.isSuccessful()) {
assert response.body() != null;
if (response.body().size() > 0) {
loadNextFlag = response.body().size() == resultLimit;
for (int i = 0; i < response.body().size(); i++) {
fastItemAdapter.add(fastItemAdapter.getAdapterItemCount(), new CommitsItems(getApplicationContext()).withNewItems(response.body().get(i).getCommit().getMessage(),
response.body().get(i).getHtml_url(), response.body().get(i).getCommit().getCommitter().getName(),
response.body().get(i).getCommit().getCommitter().getDate()));
}
footerAdapter.clear();
}
else {
footerAdapter.clear();
}
progressBar.setVisibility(View.GONE);
}
else {
Log.e(TAG, String.valueOf(response.code()));
}
}
@Override
public void onFailure(@NonNull Call<List<Commits>> call, @NonNull Throwable t) {
Log.e(TAG, t.toString());
}
});
}, 1000);
if(!loadNextFlag) {
footerAdapter.clear();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.search_menu, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
androidx.appcompat.widget.SearchView searchView = (androidx.appcompat.widget.SearchView) searchItem.getActionView();
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
fastItemAdapter.filter(newText);
return true;
}
});
endlessRecyclerOnScrollListener.enable();
return super.onCreateOptionsMenu(menu);
}
@Override
public void itemsFiltered(@Nullable CharSequence constraint, @Nullable List<CommitsItems> results) {
endlessRecyclerOnScrollListener.disable();
}
@Override
public void onReset() {
endlessRecyclerOnScrollListener.enable();
}
private void initCloseListener() {
onClickListener = view -> {
getIntent().removeExtra("branchName");
finish();
};
}
}

View File

@ -23,6 +23,7 @@ import androidx.appcompat.app.AlertDialog;
import com.tooltip.Tooltip;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
import org.mian.gitnex.helpers.NetworkObserver;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.VersionCheck;
import org.mian.gitnex.models.GiteaVersion;
@ -65,7 +66,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
super.onCreate(savedInstanceState);
TinyDB tinyDb = new TinyDB(getApplicationContext());
boolean connToInternet = AppUtil.haveNetworkConnection(getApplicationContext());
NetworkObserver networkMonitor = new NetworkObserver(this);
loginButton = findViewById(R.id.login_button);
instanceUrlET = findViewById(R.id.instance_url);
@ -105,30 +106,39 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
info_button.setOnClickListener(infoListener);
if(!connToInternet) {
loginMethod.setOnCheckedChangeListener((group, checkedId) -> {
Toasty.info(getApplicationContext(), getResources().getString(R.string.checkNetConnection));
return;
if(checkedId == R.id.loginToken) {
}
loginUidET.setVisibility(View.GONE);
loginPassword.setVisibility(View.GONE);
otpCode.setVisibility(View.GONE);
otpInfo.setVisibility(View.GONE);
loginTokenCode.setVisibility(View.VISIBLE);
loginMethod.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if(checkedId == R.id.loginUsernamePassword){
loginUidET.setVisibility(View.VISIBLE);
loginPassword.setVisibility(View.VISIBLE);
otpCode.setVisibility(View.VISIBLE);
otpInfo.setVisibility(View.VISIBLE);
loginTokenCode.setVisibility(View.GONE);
} else {
loginUidET.setVisibility(View.GONE);
loginPassword.setVisibility(View.GONE);
otpCode.setVisibility(View.GONE);
otpInfo.setVisibility(View.GONE);
loginTokenCode.setVisibility(View.VISIBLE);
}
}
else {
loginUidET.setVisibility(View.VISIBLE);
loginPassword.setVisibility(View.VISIBLE);
otpCode.setVisibility(View.VISIBLE);
otpInfo.setVisibility(View.VISIBLE);
loginTokenCode.setVisibility(View.GONE);
}
});
networkMonitor.onInternetStateListener(isAvailable -> {
if(isAvailable) {
enableProcessButton();
}
else {
disableProcessButton();
Toasty.info(getApplicationContext(), getResources().getString(R.string.checkNetConnection));
}
});
//login_button.setOnClickListener(this);

View File

@ -270,17 +270,18 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
case 4: // pull requests
fragment = new PullRequestsFragment();
break;
case 5: // milestones
return MilestonesFragment.newInstance(repoOwner, repoName);
case 6: // labels
return LabelsFragment.newInstance(repoOwner, repoName);
case 7: // branches
case 5: // branches
return BranchesFragment.newInstance(repoOwner, repoName);
case 8: // releases
case 6: // releases
return ReleasesFragment.newInstance(repoOwner, repoName);
case 7: // milestones
return MilestonesFragment.newInstance(repoOwner, repoName);
case 8: // labels
return LabelsFragment.newInstance(repoOwner, repoName);
case 9: // collaborators
return CollaboratorsFragment.newInstance(repoOwner, repoName);
}
assert fragment != null;
return fragment;
}

View File

@ -57,7 +57,7 @@ public class AdminGetUsersAdapter extends RecyclerView.Adapter<AdminGetUsersAdap
@NonNull
@Override
public AdminGetUsersAdapter.UsersViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.admin_users_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_admin_users, parent, false);
return new AdminGetUsersAdapter.UsersViewHolder(v);
}

View File

@ -1,16 +1,17 @@
package org.mian.gitnex.adapters;
import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.mian.gitnex.R;
import org.mian.gitnex.activities.CommitsActivity;
import org.mian.gitnex.models.Branches;
import org.mian.gitnex.util.TinyDB;
import java.util.List;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
@ -27,14 +28,23 @@ public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.Branch
private TextView branchNameTv;
private TextView branchCommitAuthor;
private TextView branchCommitHash;
private BranchesViewHolder(View itemView) {
super(itemView);
branchNameTv = itemView.findViewById(R.id.branchName);
branchCommitAuthor = itemView.findViewById(R.id.branchCommitAuthor);
branchCommitHash = itemView.findViewById(R.id.branchCommitHash);
TextView branchCommitHash = itemView.findViewById(R.id.branchCommitHash);
branchCommitHash.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), CommitsActivity.class);
intent.putExtra("branchName", String.valueOf(branchNameTv.getText()));
Objects.requireNonNull(v.getContext()).startActivity(intent);
}
});
}
}
@ -47,7 +57,7 @@ public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.Branch
@NonNull
@Override
public BranchesAdapter.BranchesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.branches_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_branches, parent, false);
return new BranchesAdapter.BranchesViewHolder(v);
}
@ -67,10 +77,6 @@ public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.Branch
holder.branchCommitAuthor.setText(mCtx.getResources().getString(R.string.commitAuthor, currentItem.getCommit().getAuthor().getUsername()));
}
holder.branchCommitHash.setText(
Html.fromHtml("<a href='" + currentItem.getCommit().getUrl() + "'>" + mCtx.getResources().getString(R.string.commitLinkBranchesTab) + "</a> "));
holder.branchCommitHash.setMovementMethod(LinkMovementMethod.getInstance());
}
@Override

View File

@ -58,7 +58,7 @@ public class ClosedIssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD){
return new ClosedIssuesAdapter.IssuesHolder(inflater.inflate(R.layout.repo_issues_list, parent,false));
return new ClosedIssuesAdapter.IssuesHolder(inflater.inflate(R.layout.list_issues, parent,false));
}
else {
return new ClosedIssuesAdapter.LoadHolder(inflater.inflate(R.layout.row_load,parent,false));

View File

@ -61,7 +61,7 @@ public class CollaboratorsAdapter extends BaseAdapter {
ViewHolder viewHolder = null;
if (finalView == null) {
finalView = LayoutInflater.from(mCtx).inflate(R.layout.collaborators_list, null);
finalView = LayoutInflater.from(mCtx).inflate(R.layout.list_collaborators, null);
viewHolder = new ViewHolder(finalView);
finalView.setTag(viewHolder);
}

View File

@ -10,7 +10,6 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
import com.amulyakhare.textdrawable.TextDrawable;
@ -155,7 +154,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
@NonNull
@Override
public ExploreRepositoriesAdapter.ReposSearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.repos_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_repos, parent, false);
return new ExploreRepositoriesAdapter.ReposSearchViewHolder(v);
}

View File

@ -147,7 +147,7 @@ public class FilesAdapter extends RecyclerView.Adapter<FilesAdapter.FilesViewHol
@NonNull
@Override
public FilesAdapter.FilesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.files_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_files, parent, false);
return new FilesAdapter.FilesViewHolder(v);
}

View File

@ -53,7 +53,7 @@ public class FilesDiffAdapter extends RecyclerView.Adapter<FilesDiffAdapter.File
@NonNull
@Override
public FilesDiffAdapter.FilesDiffViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.files_diffs_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_files_diffs, parent, false);
return new FilesDiffAdapter.FilesDiffViewHolder(v);
}

View File

@ -58,7 +58,7 @@ public class IssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD){
return new IssuesHolder(inflater.inflate(R.layout.repo_issues_list, parent,false));
return new IssuesHolder(inflater.inflate(R.layout.list_issues, parent,false));
}
else {
return new LoadHolder(inflater.inflate(R.layout.row_load,parent,false));

View File

@ -21,7 +21,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
@ -123,7 +122,7 @@ public class LabelsAdapter extends RecyclerView.Adapter<LabelsAdapter.LabelsView
@NonNull
@Override
public LabelsAdapter.LabelsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.labels_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_labels, parent, false);
return new LabelsAdapter.LabelsViewHolder(v);
}

View File

@ -67,7 +67,7 @@ public class MembersByOrgAdapter extends BaseAdapter implements Filterable {
MembersByOrgAdapter.ViewHolder viewHolder = null;
if (finalView == null) {
finalView = LayoutInflater.from(mCtx).inflate(R.layout.members_by_org_list, null);
finalView = LayoutInflater.from(mCtx).inflate(R.layout.list_members_by_org, null);
viewHolder = new MembersByOrgAdapter.ViewHolder(finalView);
finalView.setTag(viewHolder);
}

View File

@ -110,7 +110,7 @@ public class MilestonesAdapter extends RecyclerView.Adapter<MilestonesAdapter.Mi
@NonNull
@Override
public MilestonesAdapter.MilestonesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.milestones_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_milestones, parent, false);
return new MilestonesAdapter.MilestonesViewHolder(v);
}

View File

@ -26,7 +26,6 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
@ -158,7 +157,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
@NonNull
@Override
public MyReposListAdapter.MyReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.my_repos_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_my_repos, parent, false);
return new MyReposListAdapter.MyReposViewHolder(v);
}

View File

@ -74,7 +74,7 @@ public class OrganizationsListAdapter extends RecyclerView.Adapter<Organizations
@NonNull
@Override
public OrganizationsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.organizations_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_organizations, parent, false);
return new OrganizationsViewHolder(v);
}

View File

@ -44,7 +44,7 @@ public class ProfileEmailsAdapter extends RecyclerView.Adapter<ProfileEmailsAdap
@NonNull
@Override
public ProfileEmailsAdapter.EmailsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.profile_emails_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_profile_emails, parent, false);
return new ProfileEmailsAdapter.EmailsViewHolder(v);
}

View File

@ -47,7 +47,7 @@ public class ProfileFollowersAdapter extends RecyclerView.Adapter<ProfileFollowe
@NonNull
@Override
public ProfileFollowersAdapter.FollowersViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.profile_followers_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_profile_followers, parent, false);
return new ProfileFollowersAdapter.FollowersViewHolder(v);
}

View File

@ -47,7 +47,7 @@ public class ProfileFollowingAdapter extends RecyclerView.Adapter<ProfileFollowi
@NonNull
@Override
public ProfileFollowingAdapter.FollowingViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.profile_following_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_profile_following, parent, false);
return new ProfileFollowingAdapter.FollowingViewHolder(v);
}

View File

@ -57,7 +57,7 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
LayoutInflater inflater = LayoutInflater.from(context);
if(viewType == TYPE_LOAD){
return new PullRequestsAdapter.PullRequestsHolder(inflater.inflate(R.layout.repo_pr_list, parent,false));
return new PullRequestsAdapter.PullRequestsHolder(inflater.inflate(R.layout.list_pr, parent,false));
}
else {
return new PullRequestsAdapter.LoadHolder(inflater.inflate(R.layout.row_load,parent,false));

View File

@ -80,7 +80,7 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
@NonNull
@Override
public ReleasesAdapter.ReleasesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.releases_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_releases, parent, false);
return new ReleasesAdapter.ReleasesViewHolder(v);
}

View File

@ -63,7 +63,7 @@ public class RepoStargazersAdapter extends BaseAdapter {
RepoStargazersAdapter.ViewHolder viewHolder;
if (finalView == null) {
finalView = LayoutInflater.from(mCtx).inflate(R.layout.repo_stargazers_list, null);
finalView = LayoutInflater.from(mCtx).inflate(R.layout.list_repo_stargazers, null);
viewHolder = new ViewHolder(finalView);
finalView.setTag(viewHolder);
}

View File

@ -63,7 +63,7 @@ public class RepoWatchersAdapter extends BaseAdapter {
RepoWatchersAdapter.ViewHolder viewHolder;
if (finalView == null) {
finalView = LayoutInflater.from(mCtx).inflate(R.layout.repo_watchers_list, null);
finalView = LayoutInflater.from(mCtx).inflate(R.layout.list_repo_watchers, null);
viewHolder = new ViewHolder(finalView);
finalView.setTag(viewHolder);
}

View File

@ -4,7 +4,6 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
@ -162,7 +161,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
@NonNull
@Override
public ReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.repos_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_repos, parent, false);
return new ReposViewHolder(v);
}

View File

@ -26,7 +26,6 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
@ -159,7 +158,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
@NonNull
@Override
public RepositoriesByOrgAdapter.OrgReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.repositories_by_org_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_repositories_by_org, parent, false);
return new RepositoriesByOrgAdapter.OrgReposViewHolder(v);
}

View File

@ -159,7 +159,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
@NonNull
@Override
public StarredReposListAdapter.StarredReposViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.starred_repos_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_starred_repos, parent, false);
return new StarredReposListAdapter.StarredReposViewHolder(v);
}

View File

@ -64,7 +64,7 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
TeamMembersByOrgAdapter.ViewHolder viewHolder = null;
if (finalView == null) {
finalView = LayoutInflater.from(mCtx).inflate(R.layout.members_by_team_by_org_list, null);
finalView = LayoutInflater.from(mCtx).inflate(R.layout.list_members_by_team_by_org, null);
viewHolder = new ViewHolder(finalView);
finalView.setTag(viewHolder);
}

View File

@ -67,7 +67,7 @@ public class TeamsByOrgAdapter extends RecyclerView.Adapter<TeamsByOrgAdapter.Or
@NonNull
@Override
public TeamsByOrgAdapter.OrgTeamsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.teams_by_org_list, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_teams_by_org, parent, false);
return new TeamsByOrgAdapter.OrgTeamsViewHolder(v);
}

View File

@ -120,7 +120,7 @@ public class UserSearchAdapter extends RecyclerView.Adapter<UserSearchAdapter.Us
@NonNull
@Override
public UserSearchAdapter.UserSearchViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.collaborators_list_search, parent, false);
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_collaborators_search, parent, false);
return new UserSearchAdapter.UserSearchViewHolder(v);
}

View File

@ -1,5 +1,6 @@
package org.mian.gitnex.fragments;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@ -145,7 +146,9 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
final String finalDirName_ = dirName_;
mBreadcrumbsView.addItem(createItem(dirName));
//noinspection unchecked
mBreadcrumbsView.setCallback(new DefaultBreadcrumbsCallback<BreadcrumbItem>() {
@SuppressLint("SetTextI18n")
@Override
public void onNavigateBack(BreadcrumbItem item, int position) {

View File

@ -51,7 +51,7 @@ public class IssuesOpenFragment extends Fragment {
private int pageSize = 1;
private TextView noDataIssues;
private int resultLimit = 50;
private String requestType = "issues" ;
private String requestType = "issues";
@Nullable
@Override

View File

@ -0,0 +1,82 @@
package org.mian.gitnex.helpers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
/**
* Author M M Arif
*/
public class NetworkObserver implements LifecycleObserver {
private ConnectivityManager mConnectivityMgr;
private Context mContext;
private NetworkStateReceiver mNetworkStateReceiver;
public interface ConnectionStateListener {
void onAvailable(boolean isAvailable);
}
public NetworkObserver(Context context) {
mContext = context;
mConnectivityMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
((AppCompatActivity) mContext).getLifecycle().addObserver(this);
}
public void onInternetStateListener(ConnectionStateListener listener) {
mNetworkStateReceiver = new NetworkStateReceiver(listener);
IntentFilter intentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
mContext.registerReceiver(mNetworkStateReceiver, intentFilter);
}
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
public void onDestroy() {
((AppCompatActivity) mContext).getLifecycle().removeObserver(this);
if (mNetworkStateReceiver != null) {
mContext.unregisterReceiver(mNetworkStateReceiver);
}
}
public class NetworkStateReceiver extends BroadcastReceiver {
ConnectionStateListener mListener;
public NetworkStateReceiver(ConnectionStateListener listener) {
mListener = listener;
}
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getExtras() != null) {
NetworkInfo activeNetworkInfo = mConnectivityMgr.getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.getState() == NetworkInfo.State.CONNECTED) {
mListener.onAvailable(true); // connected
} else if (intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, Boolean.FALSE)) {
mListener.onAvailable(false); // disconnected
}
}
}
}
}

View File

@ -3,6 +3,7 @@ package org.mian.gitnex.interfaces;
import com.google.gson.JsonElement;
import org.mian.gitnex.models.AddEmail;
import org.mian.gitnex.models.Branches;
import org.mian.gitnex.models.Commits;
import org.mian.gitnex.models.ExploreRepositories;
import org.mian.gitnex.models.Files;
import org.mian.gitnex.models.MergePullRequest;
@ -259,4 +260,7 @@ public interface ApiInterface {
@POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request
Call<ResponseBody> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body MergePullRequest jsonStr);
@GET("repos/{owner}/{repo}/commits") // get all commits
Call<List<Commits>> getRepositoryCommits(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("sha") String branchName);
}

View File

@ -0,0 +1,180 @@
package org.mian.gitnex.items;
import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.mikepenz.fastadapter.FastAdapter;
import com.mikepenz.fastadapter.items.AbstractItem;
import org.mian.gitnex.R;
import org.mian.gitnex.helpers.ClickListener;
import org.mian.gitnex.helpers.TimeHelper;
import org.mian.gitnex.util.TinyDB;
import org.ocpsoft.prettytime.PrettyTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
/**
* Author M M Arif
*/
public class CommitsItems extends AbstractItem<CommitsItems, CommitsItems.ViewHolder> {
final private Context ctx;
private String commitTitle;
private String commitHtmlUrl;
private String commitCommitter;
private Date commitDate;
private boolean isSelectable = true;
public CommitsItems(Context ctx) {
this.ctx = ctx;
}
public CommitsItems withNewItems(String commitTitle, String commitHtmlUrl, String commitCommitter, Date commitDate) {
this.setNewItems(commitTitle, commitHtmlUrl, commitCommitter, commitDate);
return this;
}
private void setNewItems(String commitTitle, String commitHtmlUrl, String commitCommitter, Date commitDate) {
this.commitTitle = commitTitle;
this.commitHtmlUrl = commitHtmlUrl;
this.commitCommitter = commitCommitter;
this.commitDate = commitDate;
}
public String getCommitTitle() {
return commitTitle;
}
private String getCommitHtmlUrl() {
return commitHtmlUrl;
}
private String getcommitCommitter() {
return commitCommitter;
}
private Date getcommitDate() {
return commitDate;
}
@Override
public boolean isEnabled() {
return true;
}
@Override
public CommitsItems withEnabled(boolean enabled) {
return null;
}
@Override
public boolean isSelectable() {
return isSelectable;
}
@Override
public CommitsItems withSelectable(boolean selectable) {
this.isSelectable = selectable;
return this;
}
@Override
public int getType() {
return R.id.commitList;
}
@Override
public int getLayoutRes() {
return R.layout.list_commits;
}
@NonNull
@Override
public CommitsItems.ViewHolder getViewHolder(@NonNull View v) {
return new CommitsItems.ViewHolder(v);
}
public class ViewHolder extends FastAdapter.ViewHolder<CommitsItems> {
final TinyDB tinyDb = new TinyDB(ctx);
final String locale = tinyDb.getString("locale");
final String timeFormat = tinyDb.getString("dateFormat");
TextView commitTitleVw;
TextView commitCommitterVw;
TextView commitDateVw;
TextView commitHtmlUrlVw;
public ViewHolder(View itemView) {
super(itemView);
commitTitleVw = itemView.findViewById(R.id.commitTitleVw);
commitCommitterVw = itemView.findViewById(R.id.commitCommitterVw);
commitDateVw = itemView.findViewById(R.id.commitDateVw);
commitHtmlUrlVw = itemView.findViewById(R.id.commitHtmlUrlVw);
}
@Override
public void bindView(CommitsItems item, @NonNull List<Object> payloads) {
commitTitleVw.setText(item.getCommitTitle());
commitCommitterVw.setText(ctx.getString(R.string.commitCommittedBy, item.getcommitCommitter()));
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(item.getcommitDate());
commitDateVw.setText(createdTime);
commitDateVw.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(item.getcommitDate()), ctx));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + ctx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(item.getcommitDate());
commitDateVw.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + ctx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(item.getcommitDate());
commitDateVw.setText(createdTime);
break;
}
}
commitHtmlUrlVw.setText(Html.fromHtml("<a href='" + item.getCommitHtmlUrl() + "'>" + ctx.getResources().getString(R.string.viewInBrowser) + "</a> "));
commitHtmlUrlVw.setMovementMethod(LinkMovementMethod.getInstance());
}
@Override
public void unbindView(@NonNull CommitsItems item) {
commitTitleVw.setText(null);
commitCommitterVw.setText(null);
commitDateVw.setText(null);
commitHtmlUrlVw.setText(null);
}
}
}

View File

@ -0,0 +1,258 @@
package org.mian.gitnex.models;
import java.util.Date;
import java.util.List;
/**
* Author M M Arif
*/
public class Commits {
private String url;
private String sha;
private String html_url;
private commitObject commit;
private authorObject author;
private committerObject committer;
private List<parentObject> parent;
public String getUrl() {
return url;
}
public String getSha() {
return sha;
}
public String getHtml_url() {
return html_url;
}
public static class commitObject {
private String url;
private CommitAuthor author;
private CommitCommitter committer;
private String message;
private CommitTree tree;
public static class CommitAuthor {
String name;
String email;
Date date;
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public Date getDate() {
return date;
}
}
public static class CommitCommitter {
String name;
String email;
Date date;
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public Date getDate() {
return date;
}
}
public static class CommitTree {
String url;
String sha;
public String getUrl() {
return url;
}
public String getSha() {
return sha;
}
}
public String getUrl() {
return url;
}
public String getMessage() {
return message;
}
public CommitAuthor getAuthor() {
return author;
}
public CommitCommitter getCommitter() {
return committer;
}
public CommitTree getTree() {
return tree;
}
}
public static class authorObject {
private int id;
private String login;
private String full_name;
private String email;
private String avatar_url;
private String language;
private Boolean is_admin;
private String last_login;
private String created;
private String username;
public int getId() {
return id;
}
public String getLogin() {
return login;
}
public String getFull_name() {
return full_name;
}
public String getEmail() {
return email;
}
public String getAvatar_url() {
return avatar_url;
}
public String getLanguage() {
return language;
}
public Boolean getIs_admin() {
return is_admin;
}
public String getLast_login() {
return last_login;
}
public String getCreated() {
return created;
}
public String getUsername() {
return username;
}
}
public static class committerObject {
private int id;
private String login;
private String full_name;
private String email;
private String avatar_url;
private String language;
private Boolean is_admin;
private String last_login;
private String created;
private String username;
public int getId() {
return id;
}
public String getLogin() {
return login;
}
public String getFull_name() {
return full_name;
}
public String getEmail() {
return email;
}
public String getAvatar_url() {
return avatar_url;
}
public String getLanguage() {
return language;
}
public Boolean getIs_admin() {
return is_admin;
}
public String getLast_login() {
return last_login;
}
public String getCreated() {
return created;
}
public String getUsername() {
return username;
}
}
public static class parentObject {
private String url;
private String sha;
public String getUrl() {
return url;
}
public String getSha() {
return sha;
}
}
public commitObject getCommit() {
return commit;
}
public authorObject getAuthor() {
return author;
}
public committerObject getCommitter() {
return committer;
}
public List<parentObject> getParent() {
return parent;
}
}

View File

@ -6,8 +6,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -8,8 +8,10 @@
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/commitTitle"
android:textColor="?attr/primaryTextColor"
android:ellipsize="none"
android:scrollbars="horizontal"
android:singleLine="true"
android:layout_marginEnd="20dp"
android:textSize="18sp" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_marginTop="50dp"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:padding="4dp"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<TextView
android:id="@+id/noDataCommits"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:gravity="center"
android:text="@string/noDataFound"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
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>

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,9 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay" >
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -45,20 +45,21 @@
android:background="@drawable/shape_inputs"
android:orientation="vertical">
<RadioButton
android:id="@+id/loginUsernamePassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loginViaPassword"
android:checked="true"
android:layout_marginEnd="30dp"
android:theme="@style/radioButtonsInDarkTheme"
android:textColor="?attr/primaryTextColor"/>
<RadioButton
android:id="@+id/loginToken"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/copyToken"
android:checked="true"
android:theme="@style/radioButtonsInDarkTheme"
android:textColor="?attr/primaryTextColor"/>
<RadioButton
android:id="@+id/loginUsernamePassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loginViaPassword"
android:layout_marginEnd="30dp"
android:theme="@style/radioButtonsInDarkTheme"
android:textColor="?attr/primaryTextColor"/>
@ -129,7 +130,8 @@
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/hintColor"
android:hint="@string/userName"
android:inputType="text" />
android:inputType="text"
android:visibility="gone" />
<EditText
android:id="@+id/login_passwd"
@ -146,7 +148,8 @@
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/hintColor"
android:hint="@string/passWord"
android:inputType="textPassword" />
android:inputType="textPassword"
android:visibility="gone" />
<EditText
android:id="@+id/otpCode"
@ -163,7 +166,8 @@
android:textColorHint="?attr/hintColor"
android:textColorHighlight="?attr/hintColor"
android:hint="@string/loginOTP"
android:inputType="number" />
android:inputType="number"
android:visibility="gone" />
<EditText
android:id="@+id/loginTokenCode"
@ -181,7 +185,7 @@
android:textColorHighlight="?attr/hintColor"
android:hint="@string/copyToken"
android:inputType="text"
android:visibility="gone" />
android:visibility="visible" />
<TextView
android:id="@+id/otpInfo"
@ -192,7 +196,8 @@
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:gravity="end" />
android:gravity="end"
android:visibility="gone" />
<Button
android:layout_width="match_parent"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -13,7 +13,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"

View File

@ -13,7 +13,7 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@ -74,18 +74,6 @@
android:layout_height="wrap_content"
android:text="@string/tabPullRequests" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem3_ml"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_text_ml" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem4_labels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_text_labels" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem5_branches"
android:layout_width="wrap_content"
@ -98,6 +86,18 @@
android:layout_height="wrap_content"
android:text="@string/tab_text_releases" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem3_ml"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_text_ml" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem4_labels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab_text_labels" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem7_collaborators"
android:layout_width="wrap_content"

View File

@ -7,8 +7,10 @@
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -7,8 +7,10 @@
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -8,8 +8,10 @@
android:background="?attr/primaryBackgroundColor">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:theme="@style/Widget.AppCompat.SearchView">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -29,16 +29,16 @@
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/branchCommitHash"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:textColorLink="@color/lightBlue"/>
android:textColor="@color/lightBlue"
android:text="@string/viewCommits"
android:textSize="14sp" />
</LinearLayout>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/commitList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor">
<LinearLayout
android:id="@+id/linearLayoutFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:layout_margin="15dp"
tools:ignore="UselessParent">
<TextView
android:id="@+id/commitTitleVw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/commitTitle"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
<TextView
android:id="@+id/commitCommitterVw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/frameViewnDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/frameViewInBrowser"
android:layout_width="0dp"
android:layout_weight=".25"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/commitHtmlUrlVw"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:text="@string/viewInBrowser"
android:textColorLink="@color/lightBlue"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="@+id/commitDateVw"
android:layout_width="0dp"
android:layout_weight=".25"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_below="@id/linearLayoutFrame"
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:layout_marginTop="10dp"
android:background="?attr/dividerColor" />
</RelativeLayout>

View File

@ -508,6 +508,7 @@
<string name="strPrivate" translatable="false">private</string>
<string name="strPublic" translatable="false">public</string>
<string name="defaultCopy" translatable="false">Default</string>
<string name="viewInBrowser">View in Browser</string>
<!-- generic copy -->
<string name="translateText">Translate GitNex with Crowdin</string>
@ -563,7 +564,9 @@
<string name="sharePr">Share Pull Request</string>
<string name="shareRepository">Share Repository</string>
<string name="createRepository">Create Repository</string>
<string name="repositoryTabCommits">Commits</string>
<string name="commitTitle">Branch Commits</string>
<string name="commitCommittedBy">Committed by %1$s</string>
<string name="viewCommits">View Commits</string>
<string name="changelogTitle" translatable="false">Changelog</string>
</resources>

View File

@ -6,6 +6,7 @@
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorSecondary">@color/colorWhite</item>
<item name="primaryTextColor">@color/colorWhite</item>
<item name="primaryBackgroundColor">@color/colorPrimary</item>
@ -28,6 +29,7 @@
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorSecondary">@color/lightThemeTextColor</item>
<item name="primaryTextColor">@color/lightThemeTextColor</item>
<item name="primaryBackgroundColor">@color/lightThemeBackground</item>