This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here's the sign-in button | |
Button s= (Button)findViewById(R.id.buttons); | |
access= new Access(this); | |
s.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view){ | |
//Build the GitKitClient | |
client= access.startAuth(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud preview app deploy app.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recycler.setAdapter(new RecyclerAdapter(recycler)); | |
recycler.setLayoutManager(new LinearLayoutManager(this)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.datas = ToList(peopleAsString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setParent(){ | |
for (int x = 0; x < datas.size(); x++){ | |
Person person = datas.get(x); | |
general.add(person); | |
children.add(0); | |
person.setChildrenVisible(false); | |
Friend[] friends = person.getFriends(); | |
for (int y = 0; y < friends.length; y++){ | |
Friend f = friends[y]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ChildViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ | |
public TextView viewID; | |
public TextView parentID; | |
public TextView text; | |
public ChildViewHolder(View itemView) { | |
super(itemView); | |
viewID = (TextView) itemView.findViewById(R.id.fid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getItemViewType(int position) { | |
if (general.get(position).isParent()){ | |
return PARENT; | |
} | |
else{ | |
return CHILD; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { | |
if (holder.getItemViewType() == CHILD){ | |
TextView viewID = ((ChildViewHolder)holder).viewID; | |
TextView parentID = ((ChildViewHolder)holder).parentID; | |
TextView text = ((ChildViewHolder)holder).text; | |
Friend friend = (Friend) general.get(position); | |
viewID.setText(friend.getId()); | |
parentID.setText(friend.getParentID()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (person.getFriends().length != 0){ | |
//is view expanded? | |
if (person.isChildrenVisible()){ | |
person.setChildrenVisible(false); | |
Friend[] friends = person.getFriends(); | |
for (int i = id + 1; i < (id + 1 + friends.length); i++){ | |
general.remove(id+1); | |
} | |
Log.d("general size is ", general.size()+""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else { | |
person.setChildrenVisible(true); | |
Friend[] friends = person.getFriends(); | |
int index = 0; | |
for (int i = id + 1; i < (id + 1 + friends.length); i++){ | |
general.add(i, friends[index]); | |
index++; | |
} |
OlderNewer