Close #514, extend the duration of SnackBar
This commit is contained in:
1 parent
9d49973504
commit
ec132440e7
6 files changed
+14
-14
No files matched your search
@@ -664,7 +664,7 @@ public final class MainActivity extends StageActivity
|
||||
public void showTip(CharSequence message, int length) {
|
||||
if (null != mDrawerLayout) {
|
||||
Snackbar.make(mDrawerLayout, message,
|
||||
length == BaseScene.LENGTH_LONG ? Snackbar.LENGTH_LONG : Snackbar.LENGTH_SHORT).show();
|
||||
length == BaseScene.LENGTH_LONG ? 5000 : 3000).show();
|
||||
} else {
|
||||
Toast.makeText(this, message,
|
||||
length == BaseScene.LENGTH_LONG ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
|
||||
|
||||
@@ -744,7 +744,7 @@ public final class GalleryCommentsScene extends ToolbarScene
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
showTip(getContent().getString(R.string.comment_failed) + "\n" + ExceptionUtils.getReadableString(e), LENGTH_SHORT);
|
||||
showTip(getContent().getString(R.string.comment_failed) + "\n" + ExceptionUtils.getReadableString(e), LENGTH_LONG);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -778,7 +778,7 @@ public final class GalleryCommentsScene extends ToolbarScene
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
showTip(R.string.vote_failed, LENGTH_SHORT);
|
||||
showTip(R.string.vote_failed, LENGTH_LONG);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1241,7 +1241,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
return;
|
||||
}
|
||||
if (mGalleryDetail.apiUid < 0) {
|
||||
showTip(R.string.sign_in_first, LENGTH_SHORT);
|
||||
showTip(R.string.sign_in_first, LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
ArchiveListDialogHelper helper = new ArchiveListDialogHelper();
|
||||
@@ -1256,7 +1256,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
return;
|
||||
}
|
||||
if (mGalleryDetail.apiUid < 0) {
|
||||
showTip(R.string.sign_in_first, LENGTH_SHORT);
|
||||
showTip(R.string.sign_in_first, LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
RateDialogHelper helper = new RateDialogHelper();
|
||||
@@ -1627,7 +1627,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
showTip(mAddOrRemove ? R.string.remove_from_favorite_failure :
|
||||
R.string.add_to_favorite_failure, LENGTH_SHORT);
|
||||
R.string.add_to_favorite_failure, LENGTH_LONG);
|
||||
GalleryDetailScene scene = getScene();
|
||||
if (scene != null) {
|
||||
scene.onModifyFavoritesFailure(mAddOrRemove);
|
||||
@@ -1662,9 +1662,9 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
if (e instanceof NoHAtHClientException) {
|
||||
showTip(R.string.download_archive_failure_no_hath, LENGTH_SHORT);
|
||||
showTip(R.string.download_archive_failure_no_hath, LENGTH_LONG);
|
||||
} else {
|
||||
showTip(R.string.download_archive_failure, LENGTH_SHORT);
|
||||
showTip(R.string.download_archive_failure, LENGTH_LONG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2031,7 +2031,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
e.printStackTrace();
|
||||
showTip(R.string.rate_failed, LENGTH_SHORT);
|
||||
showTip(R.string.rate_failed, LENGTH_LONG);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -655,14 +655,14 @@ public final class GalleryListScene extends BaseScene
|
||||
|
||||
// Can't add image search as quick search
|
||||
if (ListUrlBuilder.MODE_IMAGE_SEARCH == urlBuilder.getMode()) {
|
||||
showTip(R.string.image_search_not_quick_search, LENGTH_SHORT);
|
||||
showTip(R.string.image_search_not_quick_search, LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check duplicate
|
||||
for (QuickSearch q: list) {
|
||||
if (urlBuilder.equalsQuickSearch(q)) {
|
||||
showTip(getString(R.string.duplicate_quick_search, q.name), LENGTH_SHORT);
|
||||
showTip(getString(R.string.duplicate_quick_search, q.name), LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1545,7 +1545,7 @@ public final class GalleryListScene extends BaseScene
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
showTip(R.string.add_to_favorite_failure, LENGTH_SHORT);
|
||||
showTip(R.string.add_to_favorite_failure, LENGTH_LONG);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -433,7 +433,7 @@ public class GalleryPreviewsScene extends ToolbarScene implements EasyRecyclerVi
|
||||
mDialog = null;
|
||||
}
|
||||
} else {
|
||||
showTip(R.string.error_out_of_range, LENGTH_SHORT);
|
||||
showTip(R.string.error_out_of_range, LENGTH_LONG);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ public class HistoryScene extends ToolbarScene
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
showTip(R.string.add_to_favorite_failure, LENGTH_SHORT);
|
||||
showTip(R.string.add_to_favorite_failure, LENGTH_LONG);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user