ai.pai.client.utils.ToastUtils;
public class HistoryGroupAdapter extends RecyclerView.Adapter<HistoryGroupAdapter.GroupViewHolder> {
@@ -77,11 +77,11 @@ public class HistoryGroupAdapter extends RecyclerView.Adapter<HistoryGroupAdapte
public void onClick(View v) {
try{
if(info.groupPhotoNum>0){
- Toast.makeText(context,R.string.group_photo_not_null,Toast.LENGTH_SHORT).show();
+ ToastUtils.showShortToast(context,R.string.group_photo_not_null);
return;
}
if(!info.adminId.equals(Preferences.getInstance(context).getUserId())){
- Toast.makeText(context,R.string.group_admin_not_me,Toast.LENGTH_SHORT).show();
+ ToastUtils.showShortToast(context,R.string.group_admin_not_me);
return;
}
@@ -14,7 +14,6 @@ import android.view.LayoutInflater; |
||
14 | 14 |
import android.view.View; |
15 | 15 |
import android.view.ViewGroup; |
16 | 16 |
import android.widget.LinearLayout; |
17 |
-import android.widget.Toast; |
|
18 | 17 |
|
19 | 18 |
import com.android.common.utils.LogHelper; |
20 | 19 |
|
@@ -26,6 +25,7 @@ import ai.pai.client.adapter.PhotoStaggeredAdapter; |
||
26 | 25 |
import ai.pai.client.beans.GroupPhotoItem; |
27 | 26 |
import ai.pai.client.db.DBService; |
28 | 27 |
import ai.pai.client.services.GroupService; |
28 |
+import ai.pai.client.utils.ToastUtils; |
|
29 | 29 |
|
30 | 30 |
public class GroupPhotoFragment extends BaseFragment implements GroupService.GroupServiceListener{ |
31 | 31 |
|
@@ -134,7 +134,7 @@ public class GroupPhotoFragment extends BaseFragment implements GroupService.Gr |
||
134 | 134 |
LogHelper.d(TAG,"photoFragment onCommandCommitSuccess ,command is "+command); |
135 | 135 |
switch (command){ |
136 | 136 |
case GroupService.GroupCommand.COMMAND_UPLOAD_PHOTO: |
137 |
- Toast.makeText(getActivity(),R.string.photo_upload_success,Toast.LENGTH_SHORT).show(); |
|
137 |
+ ToastUtils.showShortToast(getActivity(),R.string.photo_upload_success); |
|
138 | 138 |
case GroupService.GroupCommand.COMMAND_FETCH_PHOTOS: |
139 | 139 |
ArrayList<GroupPhotoItem> photoItems = (ArrayList<GroupPhotoItem>)response; |
140 | 140 |
if(adapter!=null&& photoItems!=null &&photoItems.size()>0){ |
@@ -10,10 +10,8 @@ import android.view.ViewGroup; |
||
10 | 10 |
import android.widget.ImageView; |
11 | 11 |
import android.widget.RelativeLayout; |
12 | 12 |
import android.widget.TextView; |
13 |
-import android.widget.Toast; |
|
14 | 13 |
|
15 | 14 |
import com.android.common.executors.ThreadExecutor; |
16 |
-import ai.pai.client.utils.HttpPostTask; |
|
17 | 15 |
import com.android.common.utils.DeviceUtils; |
18 | 16 |
import com.android.common.utils.JSONParseUtils; |
19 | 17 |
import com.android.common.utils.LogHelper; |
@@ -28,6 +26,8 @@ import ai.pai.client.beans.GroupInfo; |
||
28 | 26 |
import ai.pai.client.db.DBService; |
29 | 27 |
import ai.pai.client.db.Preferences; |
30 | 28 |
import ai.pai.client.qrcode.QRCreateUtils; |
29 |
+import ai.pai.client.utils.HttpPostTask; |
|
30 |
+import ai.pai.client.utils.ToastUtils; |
|
31 | 31 |
import ai.pai.client.utils.UrlContainer; |
32 | 32 |
|
33 | 33 |
public class GroupQRFragment extends BaseFragment { |
@@ -112,7 +112,7 @@ public class GroupQRFragment extends BaseFragment { |
||
112 | 112 |
super.onPostFail(context); |
113 | 113 |
wheel.stopSpinning(); |
114 | 114 |
wheel.setVisibility(View.GONE); |
115 |
- Toast.makeText(getActivity(),R.string.group_create_fail,Toast.LENGTH_LONG).show(); |
|
115 |
+ ToastUtils.showShortToast(getActivity(),R.string.group_create_fail); |
|
116 | 116 |
} |
117 | 117 |
|
118 | 118 |
@Override |
@@ -17,7 +17,6 @@ import android.view.LayoutInflater; |
||
17 | 17 |
import android.view.View; |
18 | 18 |
import android.view.ViewGroup; |
19 | 19 |
import android.widget.ImageView; |
20 |
-import android.widget.Toast; |
|
21 | 20 |
|
22 | 21 |
import com.android.common.executors.ThreadExecutor; |
23 | 22 |
import com.android.common.utils.LogHelper; |
@@ -41,13 +40,13 @@ import java.util.HashMap; |
||
41 | 40 |
import ai.pai.client.R; |
42 | 41 |
import ai.pai.client.activity.MainActivity; |
43 | 42 |
import ai.pai.client.adapter.RecentPhotoStaggeredAdapter; |
44 |
-import ai.pai.client.adapter.RecentPhotoStaggeredAdapter; |
|
45 | 43 |
import ai.pai.client.beans.GroupPhotoItem; |
46 | 44 |
import ai.pai.client.db.DBService; |
47 | 45 |
import ai.pai.client.db.Preferences; |
48 | 46 |
import ai.pai.client.services.MyLocationService; |
49 | 47 |
import ai.pai.client.utils.HttpPostTask; |
50 | 48 |
import ai.pai.client.utils.PhotoLoader; |
49 |
+import ai.pai.client.utils.ToastUtils; |
|
51 | 50 |
import ai.pai.client.utils.UrlContainer; |
52 | 51 |
import ai.pai.client.views.FullScreenImgPopup; |
53 | 52 |
|
@@ -111,7 +110,7 @@ public class TabRecentPhotoFragment extends BaseFragment implements SwipeRefresh |
||
111 | 110 |
doFetchPhotoTask(); |
112 | 111 |
fetchTourInfo(); |
113 | 112 |
}else{ |
114 |
- Toast.makeText(getActivity(),R.string.no_more_content,Toast.LENGTH_SHORT).show(); |
|
113 |
+ ToastUtils.showShortToast(getActivity(),R.string.no_more_content); |
|
115 | 114 |
} |
116 | 115 |
} |
117 | 116 |
}; |
@@ -7,7 +7,6 @@ import android.content.pm.PackageInfo; |
||
7 | 7 |
import android.net.Uri; |
8 | 8 |
import android.os.Handler; |
9 | 9 |
import android.os.Looper; |
10 |
-import android.widget.Toast; |
|
11 | 10 |
|
12 | 11 |
import com.android.common.http.HttpUtils; |
13 | 12 |
import com.android.common.utils.JSONParseUtils; |
@@ -23,6 +22,7 @@ import java.net.URL; |
||
23 | 22 |
|
24 | 23 |
import ai.pai.client.R; |
25 | 24 |
import ai.pai.client.utils.Constants; |
25 |
+import ai.pai.client.utils.ToastUtils; |
|
26 | 26 |
import ai.pai.client.utils.UrlContainer; |
27 | 27 |
|
28 | 28 |
/** |
@@ -52,7 +52,7 @@ public class UpgradeService extends IntentService { |
||
52 | 52 |
handler.post(new Runnable() { |
53 | 53 |
@Override |
54 | 54 |
public void run() { |
55 |
- Toast.makeText(getApplicationContext(), R.string.check_version_fail,Toast.LENGTH_SHORT).show(); |
|
55 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.check_version_fail); |
|
56 | 56 |
} |
57 | 57 |
}); |
58 | 58 |
} |
@@ -69,7 +69,7 @@ public class UpgradeService extends IntentService { |
||
69 | 69 |
handler.post(new Runnable() { |
70 | 70 |
@Override |
71 | 71 |
public void run() { |
72 |
- Toast.makeText(getApplicationContext(), R.string.current_version_is_latest,Toast.LENGTH_SHORT).show(); |
|
72 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.current_version_is_latest); |
|
73 | 73 |
} |
74 | 74 |
}); |
75 | 75 |
} |
@@ -89,7 +89,7 @@ public class UpgradeService extends IntentService { |
||
89 | 89 |
File file = new File(dir,"paiai"+System.currentTimeMillis()+".apk"); |
90 | 90 |
LogHelper.d(TAG,"需要更新,开始下载,下载到:"+file.getAbsolutePath()); |
91 | 91 |
if(!isMuteUpdate){ |
92 |
- Toast.makeText(this, R.string.new_version_found,Toast.LENGTH_SHORT).show(); |
|
92 |
+ ToastUtils.showShortToast(this, R.string.new_version_found); |
|
93 | 93 |
} |
94 | 94 |
if(!file.exists()){ |
95 | 95 |
file.createNewFile(); |
@@ -121,7 +121,7 @@ public class UpgradeService extends IntentService { |
||
121 | 121 |
handler.post(new Runnable() { |
122 | 122 |
@Override |
123 | 123 |
public void run() { |
124 |
- Toast.makeText(getApplicationContext(), R.string.check_version_fail,Toast.LENGTH_SHORT).show(); |
|
124 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.check_version_fail); |
|
125 | 125 |
} |
126 | 126 |
}); |
127 | 127 |
} |