added comments, layout fix, bug fix
This commit is contained in:
parent
892ada2dfa
commit
1ea406c1d2
@ -84,9 +84,11 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
||||
private Toolbar toolbar;
|
||||
|
||||
// list information
|
||||
private long listId;
|
||||
private String title, description;
|
||||
private boolean isPublic, belongsToCurrentUser;
|
||||
private long listId = -1;
|
||||
private String title = "";
|
||||
private String description = "";
|
||||
private boolean isPublic = false;
|
||||
private boolean belongsToCurrentUser = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle b) {
|
||||
@ -109,10 +111,10 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
||||
|
||||
Bundle param = getIntent().getExtras();
|
||||
if (param != null) {
|
||||
listId = param.getLong(KEY_LISTDETAIL_ID);
|
||||
title = param.getString(KEY_LISTDETAIL_TITLE);
|
||||
description = param.getString(KEY_LISTDETAIL_DESCR);
|
||||
isPublic = param.getBoolean(KEY_LISTDETAIL_VISIB);
|
||||
listId = param.getLong(KEY_LISTDETAIL_ID, -1);
|
||||
title = param.getString(KEY_LISTDETAIL_TITLE, "");
|
||||
description = param.getString(KEY_LISTDETAIL_DESCR, "");
|
||||
isPublic = param.getBoolean(KEY_LISTDETAIL_VISIB, false);
|
||||
belongsToCurrentUser = param.getBoolean(KEY_CURRENT_USER_OWNS, false);
|
||||
adapter.setupListContentPage(listId);
|
||||
Tab tlTab = tablayout.getTabAt(0);
|
||||
@ -185,6 +187,8 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
||||
title = data.getStringExtra(KEY_LISTDETAIL_TITLE);
|
||||
description = data.getStringExtra(KEY_LISTDETAIL_DESCR);
|
||||
isPublic = data.getBooleanExtra(KEY_LISTDETAIL_VISIB, false);
|
||||
if (title == null || description == null)
|
||||
title = description = "";
|
||||
toolbar.setTitle(title);
|
||||
toolbar.setSubtitle(description);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ListPopup extends AppCompatActivity implements OnClickListener {
|
||||
listId = extras.getLong(KEY_LIST_ID, -1);
|
||||
title = extras.getString(KEY_LIST_TITLE, "");
|
||||
description = extras.getString(KEY_LIST_DESCR, "");
|
||||
isPublic = extras.getBoolean(KEY_LIST_VISIB);
|
||||
isPublic = extras.getBoolean(KEY_LIST_VISIB, false);
|
||||
}
|
||||
titleInput.setText(title);
|
||||
subTitleInput.setText(description);
|
||||
@ -104,7 +104,7 @@ public class ListPopup extends AppCompatActivity implements OnClickListener {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (titleInput.getText().toString().equals(title)
|
||||
if (visibility.isChecked() == isPublic && titleInput.getText().toString().equals(title)
|
||||
&& subTitleInput.getText().toString().equals(description)) {
|
||||
super.onBackPressed();
|
||||
} else {
|
||||
|
@ -36,15 +36,32 @@ import static org.nuclearfog.twidda.activity.UserProfile.KEY_PROFILE_ID;
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity implements OnTabSelectedListener, OnQueryTextListener {
|
||||
|
||||
/**
|
||||
* Code returned from {@link AppSettings} when user clears the database
|
||||
*/
|
||||
public static final int RETURN_DB_CLEARED = 1;
|
||||
|
||||
/**
|
||||
* Code returned from {@link AppSettings} when user logs out from Twitter
|
||||
*/
|
||||
public static final int RETURN_APP_LOGOUT = 2;
|
||||
|
||||
/**
|
||||
* Request code for {@link LoginActivity}
|
||||
*/
|
||||
private static final int REQUEST_APP_LOGIN = 1;
|
||||
|
||||
/**
|
||||
* Request code for {@link AppSettings}
|
||||
*/
|
||||
private static final int REQUEST_APP_SETTINGS = 2;
|
||||
|
||||
private FragmentAdapter adapter;
|
||||
private TabLayout tablayout;
|
||||
private GlobalSettings settings;
|
||||
|
||||
// Views and dialogs
|
||||
private Dialog loadingCircle;
|
||||
private TabLayout tablayout;
|
||||
private ViewPager pager;
|
||||
private View root;
|
||||
|
||||
|
@ -56,8 +56,20 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
|
||||
|
||||
private static final String[] PERM_READ = {READ_EXTERNAL_STORAGE};
|
||||
private static final String[] MEDIA_MODE = {MediaStore.Images.Media.DATA};
|
||||
|
||||
/**
|
||||
* Request code for read permissions
|
||||
*/
|
||||
private static final int REQ_PERM = 3;
|
||||
|
||||
/**
|
||||
* Request code for loading new profile image
|
||||
*/
|
||||
private static final int REQ_PROFILE_IMG = 4;
|
||||
|
||||
/**
|
||||
* Request code for loading new banner image
|
||||
*/
|
||||
private static final int REQ_PROFILE_BANNER = 5;
|
||||
|
||||
private ProfileUpdater editorAsync;
|
||||
|
@ -32,11 +32,6 @@ public class TwitterList extends AppCompatActivity {
|
||||
*/
|
||||
public static final int RET_LIST_CREATED = 2;
|
||||
|
||||
/**
|
||||
* return code for {@link ListPopup} if list was updated
|
||||
*/
|
||||
public static final int RET_LIST_UPDATED = 3;
|
||||
|
||||
/**
|
||||
* Key to set up if the current user owns the lists
|
||||
*/
|
||||
|
@ -504,7 +504,6 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
|
||||
follower.setText(formatter.format(user.getFollower()));
|
||||
txtUser.setText(user.getUsername());
|
||||
txtScrName.setText(user.getScreenname());
|
||||
bioTxt.setText(bio);
|
||||
|
||||
if (profile_head.getVisibility() != VISIBLE) {
|
||||
profile_head.setVisibility(VISIBLE);
|
||||
@ -517,6 +516,12 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
|
||||
} else {
|
||||
txtLocation.setVisibility(GONE);
|
||||
}
|
||||
if (!user.getBio().isEmpty()) {
|
||||
bioTxt.setVisibility(VISIBLE);
|
||||
bioTxt.setText(bio);
|
||||
} else {
|
||||
bioTxt.setVisibility(GONE);
|
||||
}
|
||||
if (!user.getLink().isEmpty()) {
|
||||
String link = user.getLink();
|
||||
if (link.startsWith("http://"))
|
||||
|
@ -34,7 +34,7 @@ public class EngineException extends Exception {
|
||||
BITMAP_FAILURE
|
||||
}
|
||||
|
||||
private ErrorType errorType;
|
||||
private final ErrorType errorType;
|
||||
private int retryAfter;
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ public class EngineException extends Exception {
|
||||
case 17:
|
||||
case 50: // USER not found
|
||||
case 63: // USER suspended
|
||||
case 108:
|
||||
errorType = ErrorType.USER_NOT_FOUND;
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user