mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-31 19:34:55 +01:00
bug fix
This commit is contained in:
parent
5b4edbf944
commit
41a038dc5b
@ -88,6 +88,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
|||||||
private Dialog unfollowDialog, deleteDialog;
|
private Dialog unfollowDialog, deleteDialog;
|
||||||
|
|
||||||
private TwitterList twitterList;
|
private TwitterList twitterList;
|
||||||
|
private long listId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle b) {
|
protected void onCreate(@Nullable Bundle b) {
|
||||||
@ -112,7 +113,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
|||||||
|
|
||||||
Bundle param = getIntent().getExtras();
|
Bundle param = getIntent().getExtras();
|
||||||
if (param != null) {
|
if (param != null) {
|
||||||
long listId = param.getLong(KEY_LISTDETAIL_ID);
|
listId = param.getLong(KEY_LISTDETAIL_ID);
|
||||||
boolean currentUserOwnsList = param.getBoolean(KEY_CURRENT_USER_OWNS, false);
|
boolean currentUserOwnsList = param.getBoolean(KEY_CURRENT_USER_OWNS, false);
|
||||||
adapter.setupListContentPage(listId, currentUserOwnsList);
|
adapter.setupListContentPage(listId, currentUserOwnsList);
|
||||||
Tab tweetTab = tablayout.getTabAt(0);
|
Tab tweetTab = tablayout.getTabAt(0);
|
||||||
@ -265,19 +266,15 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
Bundle param = getIntent().getExtras();
|
if (USERNAME_PATTERN.matcher(query).matches()) {
|
||||||
if (param != null) {
|
if (userListManager == null || userListManager.getStatus() != RUNNING) {
|
||||||
if (USERNAME_PATTERN.matcher(query).matches()) {
|
Toast.makeText(this, R.string.info_adding_user_to_list, Toast.LENGTH_SHORT).show();
|
||||||
if (userListManager == null || userListManager.getStatus() != RUNNING) {
|
userListManager = new UserListManager(listId, ADD_USER, this, this);
|
||||||
Toast.makeText(this, R.string.info_adding_user_to_list, Toast.LENGTH_SHORT).show();
|
userListManager.execute(query);
|
||||||
long listId = param.getLong(KEY_LISTDETAIL_ID);
|
return true;
|
||||||
userListManager = new UserListManager(listId, ADD_USER, this, this);
|
|
||||||
userListManager.execute(query);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Toast.makeText(this, R.string.error_username_format, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, R.string.error_username_format, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -341,6 +338,11 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
|
|||||||
public void onFailure(EngineException err) {
|
public void onFailure(EngineException err) {
|
||||||
ErrorHandler.handleFailure(this, err);
|
ErrorHandler.handleFailure(this, err);
|
||||||
if (twitterList == null) {
|
if (twitterList == null) {
|
||||||
|
if (err.resourceNotFound()) {
|
||||||
|
Intent result = new Intent();
|
||||||
|
result.putExtra(RESULT_REMOVED_LIST_ID, listId);
|
||||||
|
setResult(RETURN_LIST_REMOVED, result);
|
||||||
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user