Improves UX
This commit is contained in:
parent
2d99e0d9ea
commit
4c96fb1670
|
@ -67,6 +67,7 @@ public class WhoToFollowActivity extends BaseActivity implements OnRetrieveWhoTo
|
||||||
private List<TrunkAccount> trunkAccounts;
|
private List<TrunkAccount> trunkAccounts;
|
||||||
private RelativeLayout mainLoader;
|
private RelativeLayout mainLoader;
|
||||||
private String listId, listTitle;
|
private String listId, listTitle;
|
||||||
|
private RelativeLayout no_action;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -87,6 +88,7 @@ public class WhoToFollowActivity extends BaseActivity implements OnRetrieveWhoTo
|
||||||
setTheme(R.style.AppThemeDark_NoActionBar);
|
setTheme(R.style.AppThemeDark_NoActionBar);
|
||||||
}
|
}
|
||||||
setContentView(R.layout.activity_who_to_follow);
|
setContentView(R.layout.activity_who_to_follow);
|
||||||
|
no_action = findViewById(R.id.no_action);
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
progess_action = findViewById(R.id.progess_action);
|
progess_action = findViewById(R.id.progess_action);
|
||||||
if( theme == THEME_BLACK)
|
if( theme == THEME_BLACK)
|
||||||
|
@ -130,9 +132,14 @@ public class WhoToFollowActivity extends BaseActivity implements OnRetrieveWhoTo
|
||||||
mainLoader.setVisibility(View.GONE);
|
mainLoader.setVisibility(View.GONE);
|
||||||
WhoToFollowAccountsAdapter whoToFollowAccountsAdapter;
|
WhoToFollowAccountsAdapter whoToFollowAccountsAdapter;
|
||||||
if( trunkAccounts != null){
|
if( trunkAccounts != null){
|
||||||
|
if( trunkAccounts.size() > 0) {
|
||||||
ListView lv_list = findViewById(R.id.lv_list);
|
ListView lv_list = findViewById(R.id.lv_list);
|
||||||
whoToFollowAccountsAdapter = new WhoToFollowAccountsAdapter(WhoToFollowActivity.this, trunkAccounts);
|
whoToFollowAccountsAdapter = new WhoToFollowAccountsAdapter(WhoToFollowActivity.this, trunkAccounts);
|
||||||
lv_list.setAdapter(whoToFollowAccountsAdapter);
|
lv_list.setAdapter(whoToFollowAccountsAdapter);
|
||||||
|
}else {
|
||||||
|
no_action.setVisibility(View.VISIBLE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
Toast.makeText(WhoToFollowActivity.this, R.string.toast_error, Toast.LENGTH_SHORT).show();
|
Toast.makeText(WhoToFollowActivity.this, R.string.toast_error, Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
|
@ -178,6 +185,11 @@ public class WhoToFollowActivity extends BaseActivity implements OnRetrieveWhoTo
|
||||||
account.setAcct(val[0]);
|
account.setAcct(val[0]);
|
||||||
account.setInstance(val[1]);
|
account.setInstance(val[1]);
|
||||||
new PostActionAsyncTask(WhoToFollowActivity.this, null, account, API.StatusAction.FOLLOW, WhoToFollowActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new PostActionAsyncTask(WhoToFollowActivity.this, null, account, API.StatusAction.FOLLOW, WhoToFollowActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
}else {
|
||||||
|
Toast.makeText(WhoToFollowActivity.this,R.string.toast_impossible_to_follow, Toast.LENGTH_LONG).show();
|
||||||
|
follow_accounts.setEnabled(true);
|
||||||
|
follow_accounts_select.setEnabled(true);
|
||||||
|
progess_action.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -599,6 +599,7 @@
|
||||||
<string name="action_remote_instance_add">You don\'t follow any remote instances. Click on the \"+\" button to add a new one.</string>
|
<string name="action_remote_instance_add">You don\'t follow any remote instances. Click on the \"+\" button to add a new one.</string>
|
||||||
<string name="about_trunk">Who to follow</string>
|
<string name="about_trunk">Who to follow</string>
|
||||||
<string name="about_trunk_action">Trunk API</string>
|
<string name="about_trunk_action">Trunk API</string>
|
||||||
|
<string name="toast_impossible_to_follow">Account(s) can\'t be followed</string>
|
||||||
|
|
||||||
|
|
||||||
<string-array translatable="false" name="proxy_type_choice">
|
<string-array translatable="false" name="proxy_type_choice">
|
||||||
|
|
Loading…
Reference in New Issue