Browse Source

reformat code

legacy
Ammar Githam 4 years ago
parent
commit
4e00d02f17
  1. 20
      app/src/main/java/awais/instagrabber/activities/DirectMessageThread.java
  2. 16
      app/src/main/java/awais/instagrabber/models/ProfileModel.java

20
app/src/main/java/awais/instagrabber/activities/DirectMessageThread.java

@ -12,15 +12,10 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.io.DataOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import awais.instagrabber.R;
import awais.instagrabber.adapters.MessageItemsAdapter;
@ -40,8 +35,6 @@ import awais.instagrabber.models.enums.UserInboxDirection;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.Utils;
import static awais.instagrabber.utils.Utils.settingsHelper;
public final class DirectMessageThread extends BaseLanguageActivity {
private DirectItemModel directItemModel;
private final ProfileModel myProfileHolder = ProfileModel.getDefaultProfileModel();
@ -61,7 +54,8 @@ public final class DirectMessageThread extends BaseLanguageActivity {
if (result != null) {
endCursor = result.getPrevCursor();
if ("MINCURSOR".equals(endCursor) || "MAXCURSOR".equals(endCursor)) endCursor = null;
if ("MINCURSOR".equals(endCursor) || "MAXCURSOR".equals(endCursor))
endCursor = null;
users.clear();
users.addAll(Arrays.asList(result.getUsers()));
@ -162,8 +156,7 @@ public final class DirectMessageThread extends BaseLanguageActivity {
.putExtra(Constants.EXTRAS_USERNAME, directItemModel.getReelShare().getReelOwnerName())
.putExtra(Constants.EXTRAS_STORIES, sms)
);
}
else if (directItemModel.getText() != null && directItemModel.getText().toString().contains("@")) {
} else if (directItemModel.getText() != null && directItemModel.getText().toString().contains("@")) {
searchUsername(directItemModel.getText().toString().split("@")[1].split(" ")[0]);
}
break;
@ -172,13 +165,10 @@ public final class DirectMessageThread extends BaseLanguageActivity {
searchUsername(directItemModel.getText().toString().split("@")[1].split(" ")[0]);
break;
default:
Log.d("austin_debug", "unsupported type "+itemType);
Log.d("austin_debug", "unsupported type " + itemType);
}
}
},
(view, text, isHashtag) -> {
searchUsername(text);
});
}, (view, text, isHashtag) -> searchUsername(text));
dmsBinding.rvDirectMessages.setAdapter(messageItemsAdapter);

16
app/src/main/java/awais/instagrabber/models/ProfileModel.java

@ -75,17 +75,25 @@ public final class ProfileModel implements Serializable {
return hdProfilePic;
}
public long getPostCount() { return postCount; }
public long getPostCount() {
return postCount;
}
public long getFollowersCount() { return followersCount; }
public long getFollowersCount() {
return followersCount;
}
public long getFollowingCount() {
return followingCount;
}
public boolean getFollowing() { return following; }
public boolean getFollowing() {
return following;
}
public boolean getRestricted() { return restricted; }
public boolean getRestricted() {
return restricted;
}
public boolean getBlocked() {
return blocked;

Loading…
Cancel
Save