Remove some features

This commit is contained in:
stom79 2018-09-09 13:58:29 +02:00
parent 3827b0d63e
commit 2b2402e5e1
30 changed files with 41 additions and 176 deletions

View File

@ -226,9 +226,7 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
public void onRetrieveRemoteAccount(Results results) {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
if( results == null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
return;
}
List<Account> accounts = results.getAccounts();

View File

@ -201,10 +201,7 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
mainLoader.setVisibility(View.GONE);
nextElementLoader.setVisibility(View.GONE);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
List<Status> statuses = apiResponse.getStatuses();

View File

@ -266,8 +266,7 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
nextElementLoader.setVisibility(View.GONE);
//Discards 404 - error which can often happen due to toots which have been deleted
if (apiResponse.getError() != null) {
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if (show_error_messages && !apiResponse.getError().getError().startsWith("404 -"))
if ( !apiResponse.getError().getError().startsWith("404 -"))
Toast.makeText(ListActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
swiped = false;

View File

@ -182,10 +182,7 @@ public class ManageAccountsInListActivity extends BaseActivity implements OnList
loader.setVisibility(View.GONE);
main_account_container.setVisibility(View.VISIBLE);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(ManageAccountsInListActivity.this, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(ManageAccountsInListActivity.this, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
if( actionType == ManageListsAsyncTask.action.GET_LIST_ACCOUNT){

View File

@ -431,9 +431,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
nextElementLoader.setVisibility(View.GONE);
//Discards 404 - error which can often happen due to toots which have been deleted
if( apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 404 ){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages )
Toast.makeText(OwnerStatusActivity.this, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(OwnerStatusActivity.this, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
swiped = false;
flag_loading = false;

View File

@ -121,9 +121,7 @@ public class PartnerShipActivity extends BaseActivity implements OnRetrieveRemot
public void onRetrieveRemoteAccount(Results results) {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
if( results == null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
return;
}
List<Account> accounts = results.getAccounts();

View File

@ -273,9 +273,7 @@ public class RemoteFollowActivity extends BaseActivity implements OnRetrieveRemo
rf_search.setEnabled(true);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
if( results == null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.toast_error,Toast.LENGTH_LONG).show();
return;
}
List<Account> accounts = results.getAccounts();
@ -295,9 +293,8 @@ public class RemoteFollowActivity extends BaseActivity implements OnRetrieveRemo
public void onRetrieveRelationship(Relationship relationship, Error error) {
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
if( error != null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
if( relationship == null)
@ -351,9 +348,8 @@ public class RemoteFollowActivity extends BaseActivity implements OnRetrieveRemo
public void onPostAction(int statusCode, API.StatusAction statusAction, String userId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(getApplicationContext(), statusCode, statusAction);

View File

@ -112,10 +112,7 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
public void onRetrieveSearch(Results results, Error error) {
loader.setVisibility(View.GONE);
if( error != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
if( results == null || (results.getAccounts().size() == 0 && results.getStatuses().size() == 0 && results.getHashtags().size() == 0)){
@ -139,10 +136,7 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
public void onRetrieveSearchStatus(APIResponse apiResponse, Error error) {
loader.setVisibility(View.GONE);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
lv_search.setVisibility(View.VISIBLE);

View File

@ -468,10 +468,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
@Override
public void onPostAction(int statusCode,API.StatusAction statusAction, String targetedId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(getApplicationContext(), statusCode, statusAction);
@ -483,10 +480,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
@Override
public void onRetrieveAccount(final Account account, Error error) {
if( error != null || account.getAcct() == null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages && error != null)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
this.account = account;
@ -898,10 +892,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
@Override
public void onRetrieveFeeds(APIResponse apiResponse) {
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = getApplicationContext().getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
@ -921,10 +912,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
public void onRetrieveRelationship(Relationship relationship, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
this.relationship = relationship;

View File

@ -270,10 +270,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
@Override
public void onRetrieveFeeds(APIResponse apiResponse) {
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
List<Status> statuses = apiResponse.getStatuses();
@ -288,10 +285,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
swipeRefreshLayout.setRefreshing(false);
RelativeLayout loader = findViewById(R.id.loader);
if( error != null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), error.getError(),Toast.LENGTH_LONG).show();
return;
}
boolean isOnWifi = Helper.isOnWIFI(getApplicationContext());

View File

@ -1312,14 +1312,10 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
@Override
public void onRetrieveAttachment(final Attachment attachment, Error error) {
if( error != null || attachment == null){
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages) {
if( error != null)
Toast.makeText(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), R.string.toast_error, Toast.LENGTH_LONG).show();
}
if( error != null)
Toast.makeText(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), R.string.toast_error, Toast.LENGTH_LONG).show();
if( attachments.size() == 0 )
toot_picture_container.setVisibility(View.GONE);
toot_picture.setEnabled(true);
@ -1359,7 +1355,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
imageView.setAdjustViewBounds(true);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, true);
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, false);
if (show_media_urls) {
//Adds the shorter text_url of attachment at the end of the toot
int selectionBefore = toot_content.getSelectionStart();
@ -1509,7 +1505,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
if( Integer.valueOf(attachment.getId()) == viewId){
attachments.remove(attachment);
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, true);
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, false);
if( show_media_urls) {
//Clears the text_url at the end of the toot for this attachment
int selectionBefore = toot_content.getSelectionStart();

View File

@ -157,10 +157,7 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
@Override
public void onPostAction(int statusCode, API.StatusAction statusAction, String userId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
holder.account_follow.setEnabled(true);
return;
}

View File

@ -136,10 +136,7 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement
@Override
public void onPostAction(int statusCode, API.StatusAction statusAction, String userId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(context, statusCode, statusAction);

View File

@ -210,10 +210,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter implements OnPostA
@Override
public void onPostAction(int statusCode, API.StatusAction statusAction, String targetedId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(context, statusCode, statusAction);

View File

@ -268,10 +268,7 @@ public class FilterAdapter extends BaseAdapter implements OnFilterActionInterfac
public void onActionDone(ManageFiltersAsyncTask.action actionType, APIResponse apiResponse, int statusCode) {
if( apiResponse != null) {
if (apiResponse.getError() != null) {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if (show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
}
List<Filters> filtersRes = apiResponse.getFilters();
if (filtersRes != null && filtersRes.size() > 0) {

View File

@ -849,10 +849,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
@Override
public void onPostAction(int statusCode, API.StatusAction statusAction, String targetedId, Error error) {
if( error != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(context, statusCode, statusAction);

View File

@ -1944,9 +1944,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
if( error != null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(context, statusCode, statusAction);

View File

@ -195,10 +195,7 @@ public class DisplayAccountsFragment extends Fragment implements OnRetrieveAccou
mainLoader.setVisibility(View.GONE);
nextElementLoader.setVisibility(View.GONE);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
swiped = false;
flag_loading = false;
@ -229,10 +226,7 @@ public class DisplayAccountsFragment extends Fragment implements OnRetrieveAccou
@Override
public void onRetrieveRelationship(APIResponse apiResponse) {
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);

View File

@ -221,10 +221,7 @@ public class DisplayFiltersFragment extends Fragment implements OnFilterActionIn
mainLoader.setVisibility(View.GONE);
add_new.setEnabled(true);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
if( actionType == ManageFiltersAsyncTask.action.GET_ALL_FILTER) {

View File

@ -178,10 +178,7 @@ public class DisplayFollowRequestSentFragment extends Fragment implements OnRetr
mainLoader.setVisibility(View.GONE);
nextElementLoader.setVisibility(View.GONE);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
flag_loading = false;
swipeRefreshLayout.setRefreshing(false);
swiped = false;

View File

@ -163,10 +163,7 @@ public class DisplayListsFragment extends Fragment implements OnListActionInterf
mainLoader.setVisibility(View.GONE);
add_new.setEnabled(true);
if( apiResponse.getError() != null){
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
return;
}
if( actionType == ManageListsAsyncTask.action.GET_LIST) {

View File

@ -167,9 +167,7 @@ public class DisplayMediaFragment extends Fragment implements OnRetrieveFeedsInt
nextElementLoader.setVisibility(View.GONE);
//Discards 404 - error which can often happen due to toots which have been deleted
if( apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 404 ){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages )
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
flag_loading = false;
return;
}

View File

@ -197,9 +197,7 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
nextElementLoader.setVisibility(View.GONE);
String lastReadNotifications = sharedpreferences.getString(Helper.LAST_NOTIFICATION_MAX_ID + userId + instance, null);
if( apiResponse.getError() != null){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
flag_loading = false;
swipeRefreshLayout.setRefreshing(false);
swiped = false;

View File

@ -290,9 +290,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
nextElementLoader.setVisibility(View.GONE);
//Discards 404 - error which can often happen due to toots which have been deleted
if( apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 404 ){
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages )
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
flag_loading = false;
return;

View File

@ -104,20 +104,7 @@ public class SettingsFragment extends Fragment {
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
final CheckBox set_show_error_messages = rootView.findViewById(R.id.set_show_error_messages);
set_show_error_messages.setChecked(show_error_messages);
set_show_error_messages.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_SHOW_ERROR_MESSAGES, set_show_error_messages.isChecked());
editor.apply();
}
});
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, true);
boolean show_media_urls = sharedpreferences.getBoolean(Helper.SET_MEDIA_URLS, false);
final CheckBox set_auto_add_media_url = rootView.findViewById(R.id.set_auto_add_media_url);
set_auto_add_media_url.setChecked(show_media_urls);
@ -304,18 +291,6 @@ public class SettingsFragment extends Fragment {
}
});
boolean multiaccount_actions = sharedpreferences.getBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, true);
final CheckBox set_multiaccount_actions = rootView.findViewById(R.id.set_multiaccount_actions);
set_multiaccount_actions.setChecked(multiaccount_actions);
set_multiaccount_actions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, set_multiaccount_actions.isChecked());
editor.apply();
}
});
boolean display_local = sharedpreferences.getBoolean(Helper.SET_DISPLAY_LOCAL, true);
final CheckBox set_display_local = rootView.findViewById(R.id.set_display_local);

View File

@ -69,7 +69,7 @@ public class CrossActions {
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
Account currentAccount = new AccountDAO(context, db).getAccountByID(userId);
List<Account> accounts = new ArrayList<>();
if( !limitedToOwner && sharedpreferences.getBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, true) && accountstmp.size() > 1 ){
if( !limitedToOwner && accountstmp.size() > 1 ){
//It's for a reply
if( status != null){
//Status is private or direct

View File

@ -294,7 +294,6 @@ public class Helper {
public static final String SET_WIFI_ONLY = "set_wifi_only";
public static final String SET_NOTIF_HOMETIMELINE = "set_notif_hometimeline";
public static final String SET_NOTIF_SILENT = "set_notif_silent";
public static final String SET_SHOW_ERROR_MESSAGES = "set_show_error_messages";
public static final String SET_EXPAND_CW = "set_expand_cw";
public static final String SET_EMBEDDED_BROWSER = "set_embedded_browser";
public static final String SET_CUSTOM_TABS = "set_custom_tabs";
@ -304,7 +303,6 @@ public class Helper {
public static final String SET_TOOT_VISIBILITY = "set_toot_visibility";
public static final String SET_DISPLAY_LOCAL = "set_display_local";
public static final String SET_DISPLAY_GLOBAL = "set_display_global";
public static final String SET_ALLOW_CROSS_ACTIONS = "set_allow_cross_actions";
public static final String SET_DISPLAY_BOOST_COUNT = "set_display_boost_count";
public static final String SET_AUTOMATICALLY_SPLIT_TOOTS = "set_automatically_split_toots";
public static final String SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE = "set_automatically_split_toots_size";

View File

@ -46,17 +46,6 @@
android:text="@string/set_share_validation_fav"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_multiaccount_actions"
android:layout_width="wrap_content"
android:text="@string/set_multiaccount_actions"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_show_error_messages"
android:layout_width="wrap_content"
android:text="@string/set_show_error_messages"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_auto_add_media_url"

View File

@ -46,18 +46,6 @@
android:text="@string/set_share_validation_fav"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_multiaccount_actions"
android:layout_width="wrap_content"
android:text="@string/set_multiaccount_actions"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_show_error_messages"
android:layout_width="wrap_content"
android:text="@string/set_show_error_messages"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_auto_add_media_url"
android:layout_width="wrap_content"

View File

@ -325,7 +325,6 @@
<string name="set_header_picture_overlay">Choose a header picture</string>
<string name="set_preview_reply">Display the number of replies in home timeline</string>
<string name="set_preview_reply_pp">Display profile pictures?</string>
<string name="set_multiaccount_actions">Allow interactions between accounts?</string>
<string name="set_fit_preview">Fit preview images</string>
<string name="set_automatically_split_toot">Automatically split toots over 500 chars in replies</string>
<string name="note_no_space">You have reached the 160 characters allowed!</string>
@ -385,7 +384,6 @@
<string name="set_title_news">News</string>
<string name="set_notification_news">Notify for new toots on the home timeline</string>
<string name="set_show_error_messages">Display error messages</string>
<string name="action_follow">Follow</string>
<string name="action_unfollow">Unfollow</string>s
<string name="action_block">Block</string>