bug fix, code cleanup and reformat
This commit is contained in:
parent
43693d7f60
commit
54baac22d0
@ -28,6 +28,7 @@
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
@ -324,6 +324,7 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
/**
|
||||
* called to scroll page to top
|
||||
*
|
||||
* @param index tab position of page
|
||||
*/
|
||||
public void scrollToTop(int index) {
|
||||
|
@ -144,11 +144,9 @@ public class ListAdapter extends Adapter<ViewHolder> {
|
||||
int position = vh.getLayoutPosition();
|
||||
if (position != NO_POSITION) {
|
||||
TwitterList list = data.get(position);
|
||||
if (!list.getListOwner().isLocked()) {
|
||||
listener.onClick(list, ListClickListener.Action.PROFILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
vh.action.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -156,10 +154,9 @@ public class ListAdapter extends Adapter<ViewHolder> {
|
||||
int position = vh.getLayoutPosition();
|
||||
if (position != NO_POSITION) {
|
||||
TwitterList list = data.get(position);
|
||||
TwitterUser owner = list.getListOwner();
|
||||
if (list.isListOwner()) {
|
||||
listener.onClick(list, ListClickListener.Action.DELETE);
|
||||
} else if (!owner.isLocked()) {
|
||||
} else {
|
||||
listener.onClick(list, ListClickListener.Action.FOLLOW);
|
||||
}
|
||||
}
|
||||
@ -171,11 +168,9 @@ public class ListAdapter extends Adapter<ViewHolder> {
|
||||
int position = vh.getLayoutPosition();
|
||||
if (position != NO_POSITION) {
|
||||
TwitterList list = data.get(position);
|
||||
if (!list.getListOwner().isLocked()) {
|
||||
listener.onClick(list, ListClickListener.Action.SUBSCRIBER);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
vh.memberCount.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -183,11 +178,9 @@ public class ListAdapter extends Adapter<ViewHolder> {
|
||||
int position = vh.getLayoutPosition();
|
||||
if (position != NO_POSITION) {
|
||||
TwitterList list = data.get(position);
|
||||
if (!list.getListOwner().isLocked()) {
|
||||
listener.onClick(list, ListClickListener.Action.MEMBER);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return vh;
|
||||
} else {
|
||||
|
@ -14,6 +14,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Background task to load location information used by twitter such as location names and world ID's
|
||||
*
|
||||
* @see AppSettings
|
||||
*/
|
||||
public class LocationListLoader extends AsyncTask<Void, Void, List<TrendLocation>> {
|
||||
|
@ -14,6 +14,7 @@ import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* Background task to send a direct messages to a user
|
||||
*
|
||||
* @see MessagePopup
|
||||
*/
|
||||
public class MessageUploader extends AsyncTask<Void, Void, Boolean> {
|
||||
|
@ -30,6 +30,7 @@ public class MessageHolder {
|
||||
|
||||
/**
|
||||
* Get receiver screen name
|
||||
*
|
||||
* @return receiver name
|
||||
*/
|
||||
public String getUsername() {
|
||||
@ -38,6 +39,7 @@ public class MessageHolder {
|
||||
|
||||
/**
|
||||
* get message text
|
||||
*
|
||||
* @return message
|
||||
*/
|
||||
public String getMessage() {
|
||||
@ -46,6 +48,7 @@ public class MessageHolder {
|
||||
|
||||
/**
|
||||
* get local path of media
|
||||
*
|
||||
* @return media path
|
||||
*/
|
||||
public String[] getMediaPath() {
|
||||
@ -54,6 +57,7 @@ public class MessageHolder {
|
||||
|
||||
/**
|
||||
* check if media is attached
|
||||
*
|
||||
* @return if media is set
|
||||
*/
|
||||
public boolean hasMedia() {
|
||||
|
@ -38,6 +38,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* Add media paths to the holder
|
||||
*
|
||||
* @param mediaLinks array of media paths from storage
|
||||
* @param mType type of media
|
||||
*/
|
||||
@ -48,6 +49,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* Add location to a tweet
|
||||
*
|
||||
* @param location location information
|
||||
*/
|
||||
public void addLocation(Location location) {
|
||||
@ -58,6 +60,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* get tweet message
|
||||
*
|
||||
* @return tweet text
|
||||
*/
|
||||
public String getText() {
|
||||
@ -66,6 +69,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* get ID of the replied tweet
|
||||
*
|
||||
* @return Tweet ID
|
||||
*/
|
||||
public long getReplyId() {
|
||||
@ -74,6 +78,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* get type of attached media if any
|
||||
*
|
||||
* @return media type
|
||||
*/
|
||||
public MediaType getMediaType() {
|
||||
@ -100,6 +105,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* get longitude of the location
|
||||
*
|
||||
* @return longitude
|
||||
*/
|
||||
public double getLongitude() {
|
||||
@ -108,6 +114,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* get latitude of the location
|
||||
*
|
||||
* @return latitude
|
||||
*/
|
||||
public double getLatitude() {
|
||||
@ -116,6 +123,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* return if holder has location information attached
|
||||
*
|
||||
* @return true if location is attached
|
||||
*/
|
||||
public boolean hasLocation() {
|
||||
@ -124,6 +132,7 @@ public class TweetHolder {
|
||||
|
||||
/**
|
||||
* return if tweet is a reply
|
||||
*
|
||||
* @return true if tweet is a reply
|
||||
*/
|
||||
public boolean isReply() {
|
||||
|
@ -31,6 +31,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* get sser name
|
||||
*
|
||||
* @return user name
|
||||
*/
|
||||
public String getName() {
|
||||
@ -39,6 +40,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* get profile link
|
||||
*
|
||||
* @return link
|
||||
*/
|
||||
public String getLink() {
|
||||
@ -47,6 +49,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* get location
|
||||
*
|
||||
* @return location name
|
||||
*/
|
||||
public String getLocation() {
|
||||
@ -55,6 +58,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* get profile description
|
||||
*
|
||||
* @return profile bio
|
||||
*/
|
||||
public String getBio() {
|
||||
@ -63,6 +67,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* get local image path
|
||||
*
|
||||
* @return image path
|
||||
*/
|
||||
public String getProfileImage() {
|
||||
@ -71,6 +76,7 @@ public class UserHolder {
|
||||
|
||||
/**
|
||||
* check if profile image path is included
|
||||
*
|
||||
* @return true if image path is included
|
||||
*/
|
||||
public boolean hasProfileImage() {
|
||||
|
@ -31,6 +31,7 @@ public class Message {
|
||||
|
||||
/**
|
||||
* construct message object from database information
|
||||
*
|
||||
* @param messageId ID of direct message
|
||||
* @param sender sender user
|
||||
* @param receiver receiver user
|
||||
|
@ -30,6 +30,7 @@ public class TrendLocation {
|
||||
|
||||
/**
|
||||
* construct location object from local
|
||||
*
|
||||
* @param placeName name of locale
|
||||
* @param id woe id
|
||||
*/
|
||||
@ -40,6 +41,7 @@ public class TrendLocation {
|
||||
|
||||
/**
|
||||
* get place name
|
||||
*
|
||||
* @return country followed by place
|
||||
*/
|
||||
public String getName() {
|
||||
@ -48,6 +50,7 @@ public class TrendLocation {
|
||||
|
||||
/**
|
||||
* get World ID
|
||||
*
|
||||
* @return woeID
|
||||
*/
|
||||
public int getWoeId() {
|
||||
|
@ -60,6 +60,7 @@ public class Tweet {
|
||||
|
||||
/**
|
||||
* Tweet constructor
|
||||
*
|
||||
* @param status twitter4j status
|
||||
* @param retweetCount set retweet count
|
||||
* @param retweeted set if tweet is retweeted by current user
|
||||
@ -141,6 +142,7 @@ public class Tweet {
|
||||
|
||||
/**
|
||||
* Tweet constructor for database tweets
|
||||
*
|
||||
* @param tweetID unique id of tweet
|
||||
* @param retweetCount number of retweets
|
||||
* @param favoriteCount number of favors
|
||||
|
@ -98,6 +98,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get user id
|
||||
*
|
||||
* @return id
|
||||
*/
|
||||
public long getId() {
|
||||
@ -106,6 +107,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get User name
|
||||
*
|
||||
* @return username
|
||||
*/
|
||||
public String getUsername() {
|
||||
@ -114,6 +116,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get @screenname
|
||||
*
|
||||
* @return screen name
|
||||
*/
|
||||
public String getScreenname() {
|
||||
@ -122,6 +125,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get date of creation
|
||||
*
|
||||
* @return raw time
|
||||
*/
|
||||
public long getCreatedAt() {
|
||||
@ -130,6 +134,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get Profile image_add link
|
||||
*
|
||||
* @return link
|
||||
*/
|
||||
public String getImageLink() {
|
||||
@ -138,6 +143,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get banner image_add link
|
||||
*
|
||||
* @return link
|
||||
*/
|
||||
public String getBannerLink() {
|
||||
@ -146,6 +152,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get user bio
|
||||
*
|
||||
* @return bio text
|
||||
*/
|
||||
public String getBio() {
|
||||
@ -154,6 +161,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get location name
|
||||
*
|
||||
* @return name
|
||||
*/
|
||||
public String getLocation() {
|
||||
@ -162,6 +170,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get link
|
||||
*
|
||||
* @return link
|
||||
*/
|
||||
public String getLink() {
|
||||
@ -170,6 +179,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* user verified
|
||||
*
|
||||
* @return if verified
|
||||
*/
|
||||
public boolean isVerified() {
|
||||
@ -178,6 +188,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* user locked
|
||||
*
|
||||
* @return if locked
|
||||
*/
|
||||
public boolean isLocked() {
|
||||
@ -186,6 +197,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* requested follow
|
||||
*
|
||||
* @return if a follow was requested
|
||||
*/
|
||||
public boolean followRequested() {
|
||||
@ -194,6 +206,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get following count
|
||||
*
|
||||
* @return following
|
||||
*/
|
||||
public int getFollowing() {
|
||||
@ -202,6 +215,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get follower count
|
||||
*
|
||||
* @return follower count
|
||||
*/
|
||||
public int getFollower() {
|
||||
@ -210,6 +224,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get Tweet count of user
|
||||
*
|
||||
* @return tweet count
|
||||
*/
|
||||
public int getTweetCount() {
|
||||
@ -218,6 +233,7 @@ public class TwitterUser {
|
||||
|
||||
/**
|
||||
* get count of favored tweets
|
||||
*
|
||||
* @return tweet count
|
||||
*/
|
||||
public int getFavorCount() {
|
||||
|
@ -34,6 +34,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* screen name of target user
|
||||
*
|
||||
* @return screen name
|
||||
*/
|
||||
public String getTargetScreenname() {
|
||||
@ -42,6 +43,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if target user is authenticating user
|
||||
*
|
||||
* @return true if target user is current user
|
||||
*/
|
||||
public boolean isHome() {
|
||||
@ -50,6 +52,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if target user is followed by current user
|
||||
*
|
||||
* @return true if target user is followed by current user
|
||||
*/
|
||||
public boolean isFriend() {
|
||||
@ -58,6 +61,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if target user is following current user
|
||||
*
|
||||
* @return true if target user is following current user
|
||||
*/
|
||||
public boolean isFollower() {
|
||||
@ -66,6 +70,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if current user is blocking target user
|
||||
*
|
||||
* @return true if current user is blocking target user
|
||||
*/
|
||||
public boolean isBlocked() {
|
||||
@ -74,6 +79,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if current user is muting target user
|
||||
*
|
||||
* @return true if current user is muting target user
|
||||
*/
|
||||
public boolean isMuted() {
|
||||
@ -82,6 +88,7 @@ public class UserRelation {
|
||||
|
||||
/**
|
||||
* return if target user can receive direct message
|
||||
*
|
||||
* @return true if target user can receive direct messages
|
||||
*/
|
||||
public boolean canDm() {
|
||||
|
@ -35,6 +35,7 @@ public abstract class FontTool {
|
||||
|
||||
/**
|
||||
* Set fonts to all text elements in a view
|
||||
*
|
||||
* @param settings current font settings
|
||||
* @param v Root view containing views
|
||||
*/
|
||||
|
@ -2,4 +2,6 @@
|
||||
<resources>
|
||||
<color name="half_transparent">#40000000</color>
|
||||
<color name="bright_transparent">#afffffff</color>
|
||||
<color name="positive_button">#ffff4000</color>
|
||||
<color name="negative_button">#ff0040ff</color>
|
||||
</resources>
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="colorAccent">@android:color/white</item>
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
@ -56,12 +57,11 @@
|
||||
</style>
|
||||
|
||||
<style name="NegativeButton" parent="Widget.AppCompat.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@android:color/holo_red_dark</item>
|
||||
<item name="android:textColor">@color/negative_button</item>
|
||||
</style>
|
||||
|
||||
<style name="PositiveButton" parent="Widget.AppCompat.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@android:color/holo_red_light</item>
|
||||
<item name="android:textColor">@color/positive_button</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user