List of usage examples for org.eclipse.jgit.revplot PlotCommit getCommitterIdent
public final PersonIdent getCommitterIdent()
From source file:com.madgag.agit.CommitDetailsFragment.java
License:Open Source License
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try {/*from ww w .jav a 2 s .c o m*/ Repository repository = new FileRepository(gitDirFrom(getArguments())); ObjectId commitId = revisionIdFrom(repository, getArguments(), REVISION); Log.d(TAG, "onCreateView with " + commitId); View v = inflater.inflate(R.layout.commit_detail_view, container, false); CommitNavigationView commitNavigationView = (CommitNavigationView) v .findViewById(R.id.commit_navigation); commitNavigationView.setCommitSelectedListener(commitSelectedListener); PlotCommit<PlotLane> commit = commitSelectedListener.plotCommitFor(commitId); commitNavigationView.setCommit(commit); ((ObjectIdView) v.findViewById(R.id.commit_id)).setObjectId(commit); ViewGroup vg = (ViewGroup) v.findViewById(R.id.commit_people_group); PersonIdent author = commit.getAuthorIdent(), committer = commit.getCommitterIdent(); if (author.equals(committer)) { addPerson("Author & Committer", author, vg); } else { addPerson("Author", author, vg); addPerson("Committer", committer, vg); } TextView textView = (TextView) v.findViewById(R.id.commit_message_text); textView.setText(commit.getFullMessage()); return v; } catch (IOException e) { throw new RuntimeException(e); } }
From source file:com.madgag.agit.CommitView.java
License:Open Source License
private void showCommitDetailsFor(final PlotCommit<PlotLane> commit) { commitNavigationView = (CommitNavigationView) findViewById(R.id.commit_navigation); Log.d("CV", "Got commitNavigationView=" + commitNavigationView + " commitSelectedListener=" + commitSelectedListener);// w w w . ja v a 2 s.c o m commitNavigationView.setCommitSelectedListener(commitSelectedListener); ((ObjectIdView) findViewById(R.id.commit_id)).setObjectId(commit); ViewGroup vg = (ViewGroup) findViewById(R.id.commit_people_group); PersonIdent author = commit.getAuthorIdent(), committer = commit.getCommitterIdent(); if (author.equals(committer)) { addPerson("Author & Committer", author, vg); } else { addPerson("Author", author, vg); addPerson("Committer", committer, vg); } // ViewGroup vg = (ViewGroup) findViewById(R.id.commit_refs_group); // for (int i=0; i<commit.getRefCount(); ++i) { // TextView tv = new TextView(getContext()); // tv.setText(commit.getRef(i).getName()); // vg.addView(tv); // } TextView textView = (TextView) findViewById(R.id.commit_message_text); textView.setText(commit.getFullMessage()); // // int width=textView.getBackground().getIntrinsicWidth(); // textView.getBackground is null at somepoint? // Log.d("CV", "M Width = "+width); // textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, width/80); }