Skip to content

Commit

Permalink
Remove user name
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian King committed Nov 10, 2016
1 parent 65a0568 commit 55b0e48
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ public static RequestBuilder<?> buildProductView(String productId) {
/**
* Creates a builder which tracks a purchase.
*
* @param placement The placement.
* @param orderId The ID of the order for the purchase.
* @param products The products that were purchased.
* @return The created builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,13 @@ public void run() {
}

@Override
public void onError(Error error) {
Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
public void onError(final Error error) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
}

Expand Down
14 changes: 3 additions & 11 deletions testApp/src/main/java/com/richrelevance/richrelevance/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,25 @@

public class User extends SugarRecord implements Parcelable {

private String name;

private String userID;

public User() {}

public User(String name, String userID) {
this.name = name;
public User(String userID) {
this.userID = userID;
save();
}

public String getName() {
return name;
}

public String getUserID() {
return userID;
}

public User(Parcel in){
String[] data = new String[2];
String[] data = new String[1];

in.readStringArray(data);
this.name = data[0];
this.userID = data[1];
this.userID = data[0];
}

@Override
Expand All @@ -44,7 +37,6 @@ public int describeContents(){
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeStringArray(new String[] {
this.name,
this.userID});
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ private void launchCreateUser() {
@Override
public void onClick(DialogInterface dialog, int which) {
Dialog d = (Dialog) dialog;
EditText nameField = (EditText) d.findViewById(R.id.name);
EditText userIdField = (EditText) d.findViewById(R.id.userId);

User user = new User(nameField.getText().toString(), userIdField.getText().toString());
User user = new User(userIdField.getText().toString());
adapter.addUser(user);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public UserListingViewHolder(View itemView) {
}

public void bind(final User user) {
userIdTextView.setText(user.getName() + "(" + user.getUserID() + ")");
userIdTextView.setText(user.getUserID());

view.setSelected(user == selectedUser);
view.setOnClickListener(new View.OnClickListener() {
Expand Down
6 changes: 0 additions & 6 deletions testApp/src/main/res/layout/dialog_create_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
android:layout_height="match_parent"
android:layout_margin="@dimen/margin.standard">

<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="Name"/>

<EditText
android:id="@+id/userId"
android:layout_width="match_parent"
Expand Down

0 comments on commit 55b0e48

Please sign in to comment.