strings fixes and toast removed

This commit is contained in:
Domagalski 2019-01-03 21:30:43 +01:00
parent d9ada9319b
commit 3a6f20d12e
5 changed files with 8 additions and 7 deletions

View File

@ -168,8 +168,6 @@ public class BlackList extends AppCompatActivity {
@Override @Override
public void onSuccess(User user) { public void onSuccess(User user) {
blacklistedUsers.add(user); blacklistedUsers.add(user);
Snackbar.make(getWindow().getDecorView().getRootView(), "user fetch OK! success", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
toggleEmptyNotes(); toggleEmptyNotes();
if (blacklistedUsers.size() == blacklistedUsersIDs.size()) { if (blacklistedUsers.size() == blacklistedUsersIDs.size()) {
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
@ -244,6 +242,9 @@ public class BlackList extends AppCompatActivity {
if (e instanceof HttpException) { if (e instanceof HttpException) {
ResponseBody responseBody = ((HttpException) e).response().errorBody(); ResponseBody responseBody = ((HttpException) e).response().errorBody();
message = RestApiHelper.getErrorMessage(responseBody); message = RestApiHelper.getErrorMessage(responseBody);
if (((HttpException) e).response().code() == 404) {
message = getString(R.string.no_such_a_user);
}
} else { } else {
message = "Network Error !"; message = "Network Error !";
} }

View File

@ -199,7 +199,6 @@ public class MapActivity extends BaseActivity
private void createMarkerModalView(User user) { private void createMarkerModalView(User user) {
String cordStatus = coordsMap.get(user.getId()).getLabel(); String cordStatus = coordsMap.get(user.getId()).getLabel();
String sharingLevel = coordsMap.get(user.getId()).getDisplayMode(); String sharingLevel = coordsMap.get(user.getId()).getDisplayMode();
user.statu
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getApplicationContext()); LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getApplicationContext());
@SuppressLint("InflateParams") View view = layoutInflaterAndroid.inflate(R.layout.marker_modal, null); @SuppressLint("InflateParams") View view = layoutInflaterAndroid.inflate(R.layout.marker_modal, null);

View File

@ -155,8 +155,6 @@ public class WhiteList extends AppCompatActivity {
@Override @Override
public void onSuccess(User user) { public void onSuccess(User user) {
whitelistedUsers.add(user); whitelistedUsers.add(user);
Snackbar.make(getWindow().getDecorView().getRootView(), "user fetch OK! success", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
toggleEmptyNotes(); toggleEmptyNotes();
if (whitelistedUsers.size() == whitelistedUsersIDs.size()) { if (whitelistedUsers.size() == whitelistedUsersIDs.size()) {
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
@ -231,11 +229,12 @@ public class WhiteList extends AppCompatActivity {
if (e instanceof HttpException) { if (e instanceof HttpException) {
ResponseBody responseBody = ((HttpException) e).response().errorBody(); ResponseBody responseBody = ((HttpException) e).response().errorBody();
message = RestApiHelper.getErrorMessage(responseBody); message = RestApiHelper.getErrorMessage(responseBody);
if (((HttpException) e).response().code() == 404) {
message = getString(R.string.no_such_a_user);
}
} else { } else {
message = "Network Error !"; message = "Network Error !";
} }
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG) Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG)
.setAction("Action", null).show(); .setAction("Action", null).show();

View File

@ -260,6 +260,7 @@
<string name="activity_title_whitelist">Biała lista</string> <string name="activity_title_whitelist">Biała lista</string>
<string name="title_activity_white_list">Biała lista</string> <string name="title_activity_white_list">Biała lista</string>
<string name="white_list_title">Dodaj użytkownika do białej listy</string> <string name="white_list_title">Dodaj użytkownika do białej listy</string>
<string name="no_such_a_user">Nie ma takiego użytkownika</string>
</resources> </resources>

View File

@ -427,5 +427,6 @@
<string name="no_online_users">Currently, there are no\nonline users.</string> <string name="no_online_users">Currently, there are no\nonline users.</string>
<string name="no_offline_users">Currently, there are no\noffline users.</string> <string name="no_offline_users">Currently, there are no\noffline users.</string>
<string name="only_online_users">Only online users</string> <string name="only_online_users">Only online users</string>
<string name="no_such_a_user">No such a user</string>
</resources> </resources>