@@ -3,9 +3,7 @@ package ai.pai.client.activity; |
||
| 3 | 3 |
import android.content.Intent; |
| 4 | 4 |
import android.os.Bundle; |
| 5 | 5 |
import android.support.v4.app.FragmentActivity; |
| 6 |
-import android.support.v7.app.AppCompatActivity; |
|
| 7 | 6 |
import android.view.View; |
| 8 |
-import android.widget.Toast; |
|
| 9 | 7 |
|
| 10 | 8 |
import com.android.common.utils.NetworkUtil; |
| 11 | 9 |
import com.umeng.analytics.MobclickAgent; |
@@ -16,6 +14,7 @@ import ai.pai.client.swipelayout.SwipeBackActivityBase; |
||
| 16 | 14 |
import ai.pai.client.swipelayout.SwipeBackActivityHelper; |
| 17 | 15 |
import ai.pai.client.swipelayout.SwipeBackLayout; |
| 18 | 16 |
import ai.pai.client.swipelayout.Utils; |
| 17 |
+import ai.pai.client.utils.ToastUtils; |
|
| 19 | 18 |
|
| 20 | 19 |
/** |
| 21 | 20 |
* Created by chengzhenyu on 2015/12/2. |
@@ -33,7 +32,7 @@ public class BaseActivity extends FragmentActivity implements SwipeBackActivityB |
||
| 33 | 32 |
mHelper = new SwipeBackActivityHelper(this); |
| 34 | 33 |
mHelper.onActivityCreate(); |
| 35 | 34 |
if(!NetworkUtil.isNetworkConnected(this)){
|
| 36 |
- Toast.makeText(this, R.string.network_disconnect,Toast.LENGTH_SHORT).show(); |
|
| 35 |
+ ToastUtils.showShortToast(this,R.string.network_disconnect); |
|
| 37 | 36 |
} |
| 38 | 37 |
} |
| 39 | 38 |
|
@@ -8,17 +8,17 @@ import android.view.View; |
||
| 8 | 8 |
import android.widget.Button; |
| 9 | 9 |
import android.widget.EditText; |
| 10 | 10 |
import android.widget.TextView; |
| 11 |
-import android.widget.Toast; |
|
| 12 | 11 |
|
| 13 | 12 |
import com.android.common.executors.ThreadExecutor; |
| 14 |
-import ai.pai.client.utils.HttpPostTask; |
|
| 15 | 13 |
import com.android.common.utils.NetworkUtil; |
| 16 | 14 |
|
| 17 | 15 |
import java.util.HashMap; |
| 18 | 16 |
|
| 19 | 17 |
import ai.pai.client.R; |
| 20 | 18 |
import ai.pai.client.db.Preferences; |
| 19 |
+import ai.pai.client.utils.HttpPostTask; |
|
| 21 | 20 |
import ai.pai.client.utils.SystemUtils; |
| 21 |
+import ai.pai.client.utils.ToastUtils; |
|
| 22 | 22 |
import ai.pai.client.utils.UrlContainer; |
| 23 | 23 |
|
| 24 | 24 |
public class FeedbackActivity extends BaseActivity implements View.OnClickListener{
|
@@ -75,7 +75,7 @@ public class FeedbackActivity extends BaseActivity implements View.OnClickListen |
||
| 75 | 75 |
return; |
| 76 | 76 |
} |
| 77 | 77 |
if(!NetworkUtil.isNetworkConnected(this)){
|
| 78 |
- Toast.makeText(this,R.string.network_disconnect,Toast.LENGTH_SHORT).show(); |
|
| 78 |
+ ToastUtils.showShortToast(this,R.string.network_disconnect); |
|
| 79 | 79 |
return; |
| 80 | 80 |
} |
| 81 | 81 |
String feedback = feedbackET.getText().toString(); |
@@ -90,7 +90,7 @@ public class FeedbackActivity extends BaseActivity implements View.OnClickListen |
||
| 90 | 90 |
params.put("user_id",userId);
|
| 91 | 91 |
params.put("feedback",feedback);
|
| 92 | 92 |
new HttpPostTask(this,params).executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), UrlContainer.FEEDBACK_URL); |
| 93 |
- Toast.makeText(this,R.string.thank_feedback,Toast.LENGTH_SHORT).show(); |
|
| 93 |
+ ToastUtils.showShortToast(this,R.string.thank_feedback); |
|
| 94 | 94 |
finish(); |
| 95 | 95 |
} |
| 96 | 96 |
} |
@@ -13,7 +13,6 @@ import android.view.animation.CycleInterpolator; |
||
| 13 | 13 |
import android.widget.ImageButton; |
| 14 | 14 |
import android.widget.ImageView; |
| 15 | 15 |
import android.widget.TextView; |
| 16 |
-import android.widget.Toast; |
|
| 17 | 16 |
|
| 18 | 17 |
import com.hanks.htextview.HTextView; |
| 19 | 18 |
import com.hanks.htextview.HTextViewType; |
@@ -30,6 +29,7 @@ import ai.pai.client.services.GroupService; |
||
| 30 | 29 |
import ai.pai.client.utils.Constants; |
| 31 | 30 |
import ai.pai.client.utils.GroupCreateUtils; |
| 32 | 31 |
import ai.pai.client.utils.SystemUtils; |
| 32 |
+import ai.pai.client.utils.ToastUtils; |
|
| 33 | 33 |
import ai.pai.client.utils.UmengEvent; |
| 34 | 34 |
import ai.pai.client.views.GroupQRPopup; |
| 35 | 35 |
|
@@ -115,7 +115,7 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener, |
||
| 115 | 115 |
groupId = qrFragment.getGroupId(); |
| 116 | 116 |
} |
| 117 | 117 |
if (TextUtils.isEmpty(groupId)) {
|
| 118 |
- Toast.makeText(GroupActivity.this, R.string.group_detail_fetch_fail, Toast.LENGTH_SHORT).show(); |
|
| 118 |
+ ToastUtils.showShortToast(this,R.string.group_detail_fetch_fail); |
|
| 119 | 119 |
finish(); |
| 120 | 120 |
return; |
| 121 | 121 |
} |
@@ -10,7 +10,6 @@ import android.support.v7.widget.LinearLayoutManager; |
||
| 10 | 10 |
import android.support.v7.widget.RecyclerView; |
| 11 | 11 |
import android.view.View; |
| 12 | 12 |
import android.widget.TextView; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.android.views.swiperefreshrecyclerview.DividerItemDecoration; |
| 16 | 15 |
|
@@ -21,6 +20,7 @@ import ai.pai.client.adapter.GroupMemberAdapter; |
||
| 21 | 20 |
import ai.pai.client.beans.GroupMemberInfo; |
| 22 | 21 |
import ai.pai.client.services.GroupService; |
| 23 | 22 |
import ai.pai.client.utils.SystemUtils; |
| 23 |
+import ai.pai.client.utils.ToastUtils; |
|
| 24 | 24 |
|
| 25 | 25 |
public class GroupDeleteMemberActivity extends BaseActivity implements View.OnClickListener,GroupService.GroupServiceListener{
|
| 26 | 26 |
|
@@ -83,14 +83,14 @@ public class GroupDeleteMemberActivity extends BaseActivity implements View.OnCl |
||
| 83 | 83 |
@Override |
| 84 | 84 |
public void onCommandCommitFail(int command, String msg) {
|
| 85 | 85 |
if( GroupService.GroupCommand.COMMAND_DELETE_GROUP_MEMBER == command){
|
| 86 |
- Toast.makeText(getApplicationContext(), R.string.delete_member_fail,Toast.LENGTH_SHORT).show(); |
|
| 86 |
+ ToastUtils.showShortToast(this,R.string.delete_member_fail); |
|
| 87 | 87 |
} |
| 88 | 88 |
} |
| 89 | 89 |
|
| 90 | 90 |
@Override |
| 91 | 91 |
public void onCommandCommitSuccess(int command, Object response) {
|
| 92 | 92 |
if( GroupService.GroupCommand.COMMAND_DELETE_GROUP_MEMBER == command){
|
| 93 |
- Toast.makeText(getApplicationContext(), R.string.delete_member_success,Toast.LENGTH_SHORT).show(); |
|
| 93 |
+ ToastUtils.showShortToast(this,R.string.delete_member_success); |
|
| 94 | 94 |
} |
| 95 | 95 |
if(adapter!=null){
|
| 96 | 96 |
adapter.notifyDataSetChanged(); |
@@ -10,7 +10,6 @@ import android.support.v7.widget.RecyclerView; |
||
| 10 | 10 |
import android.view.LayoutInflater; |
| 11 | 11 |
import android.view.View; |
| 12 | 12 |
import android.widget.TextView; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.android.common.executors.ThreadExecutor; |
| 16 | 15 |
import com.android.common.utils.JSONParseUtils; |
@@ -33,6 +32,7 @@ import ai.pai.client.db.DBService; |
||
| 33 | 32 |
import ai.pai.client.db.Preferences; |
| 34 | 33 |
import ai.pai.client.utils.HttpPostTask; |
| 35 | 34 |
import ai.pai.client.utils.SystemUtils; |
| 35 |
+import ai.pai.client.utils.ToastUtils; |
|
| 36 | 36 |
import ai.pai.client.utils.UrlContainer; |
| 37 | 37 |
|
| 38 | 38 |
public class GroupListActivity extends BaseActivity implements View.OnClickListener,SwipeRefreshLayout.OnRefreshListener, HistoryGroupAdapter.GroupActionListener {
|
@@ -81,7 +81,7 @@ public class GroupListActivity extends BaseActivity implements View.OnClickListe |
||
| 81 | 81 |
loadMoreView.setVisibility(View.VISIBLE); |
| 82 | 82 |
doFetchGroupTask(); |
| 83 | 83 |
}else{
|
| 84 |
- Toast.makeText(GroupListActivity.this,R.string.no_more_content,Toast.LENGTH_SHORT).show(); |
|
| 84 |
+ ToastUtils.showShortToast(GroupListActivity.this,R.string.no_more_content); |
|
| 85 | 85 |
} |
| 86 | 86 |
|
| 87 | 87 |
} |
@@ -189,7 +189,7 @@ public class GroupListActivity extends BaseActivity implements View.OnClickListe |
||
| 189 | 189 |
DBService.getInstance(context).addHistoryList(groupItems); |
| 190 | 190 |
}else{
|
| 191 | 191 |
if(refreshAdapter.getItemCount()==0){
|
| 192 |
- Toast.makeText(context,R.string.no_history_group_tip,Toast.LENGTH_SHORT).show(); |
|
| 192 |
+ ToastUtils.showShortToast(context,R.string.no_history_group_tip); |
|
| 193 | 193 |
} |
| 194 | 194 |
} |
| 195 | 195 |
} |
@@ -9,7 +9,6 @@ import android.os.IBinder; |
||
| 9 | 9 |
import android.view.View; |
| 10 | 10 |
import android.widget.EditText; |
| 11 | 11 |
import android.widget.TextView; |
| 12 |
-import android.widget.Toast; |
|
| 13 | 12 |
|
| 14 | 13 |
import ai.pai.client.R; |
| 15 | 14 |
import ai.pai.client.beans.GroupInfo; |
@@ -17,6 +16,7 @@ import ai.pai.client.db.DBService; |
||
| 17 | 16 |
import ai.pai.client.db.Preferences; |
| 18 | 17 |
import ai.pai.client.services.GroupService; |
| 19 | 18 |
import ai.pai.client.utils.SystemUtils; |
| 19 |
+import ai.pai.client.utils.ToastUtils; |
|
| 20 | 20 |
|
| 21 | 21 |
public class GroupRenameActivity extends BaseActivity implements View.OnClickListener,GroupService.GroupServiceListener{
|
| 22 | 22 |
|
@@ -77,15 +77,15 @@ public class GroupRenameActivity extends BaseActivity implements View.OnClickLis |
||
| 77 | 77 |
newGroupName = groupNameEdit.getText().toString(); |
| 78 | 78 |
} |
| 79 | 79 |
if(newGroupName.replace(" ","").length()==0){
|
| 80 |
- Toast.makeText(this,R.string.group_name_null,Toast.LENGTH_SHORT).show(); |
|
| 80 |
+ ToastUtils.showShortToast(this,R.string.group_name_null); |
|
| 81 | 81 |
return; |
| 82 | 82 |
} |
| 83 | 83 |
if(newGroupName.length()>20){
|
| 84 |
- Toast.makeText(this,R.string.group_name_too_long,Toast.LENGTH_SHORT).show(); |
|
| 84 |
+ ToastUtils.showShortToast(this,R.string.group_name_too_long); |
|
| 85 | 85 |
return; |
| 86 | 86 |
} |
| 87 | 87 |
if(newGroupName.equals(groupName)){
|
| 88 |
- Toast.makeText(this,R.string.group_name_same,Toast.LENGTH_SHORT).show(); |
|
| 88 |
+ ToastUtils.showShortToast(this,R.string.group_name_same); |
|
| 89 | 89 |
return; |
| 90 | 90 |
} |
| 91 | 91 |
|
@@ -110,7 +110,7 @@ public class GroupRenameActivity extends BaseActivity implements View.OnClickLis |
||
| 110 | 110 |
@Override |
| 111 | 111 |
public void onCommandCommitFail(int command, String msg) {
|
| 112 | 112 |
if( GroupService.GroupCommand.COMMAND_UPDATE_GROUP_INFO == command){
|
| 113 |
- Toast.makeText(getApplicationContext(), R.string.edit_group_info_fail,Toast.LENGTH_SHORT).show(); |
|
| 113 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.edit_group_info_fail); |
|
| 114 | 114 |
} |
| 115 | 115 |
} |
| 116 | 116 |
|
@@ -120,7 +120,7 @@ public class GroupRenameActivity extends BaseActivity implements View.OnClickLis |
||
| 120 | 120 |
groupInfo.groupName = newGroupName; |
| 121 | 121 |
DBService.getInstance(getApplicationContext()).updateGroupInfo(groupInfo); |
| 122 | 122 |
DBService.getInstance(getApplicationContext()).updateGroupPhotoListAfterRename(groupId,newGroupName); |
| 123 |
- Toast.makeText(getApplicationContext(), R.string.group_name_modify_success,Toast.LENGTH_SHORT).show(); |
|
| 123 |
+ ToastUtils.showShortToast(this,R.string.group_name_modify_success); |
|
| 124 | 124 |
Bundle bundle = new Bundle(); |
| 125 | 125 |
bundle.putString("group_name",newGroupName);
|
| 126 | 126 |
setResult(RESULT_OK,getIntent().putExtras(bundle)); |
@@ -29,6 +29,7 @@ import ai.pai.client.db.DBService; |
||
| 29 | 29 |
import ai.pai.client.services.GroupService; |
| 30 | 30 |
import ai.pai.client.utils.PhotoLoader; |
| 31 | 31 |
import ai.pai.client.utils.SystemUtils; |
| 32 |
+import ai.pai.client.utils.ToastUtils; |
|
| 32 | 33 |
import ai.pai.client.utils.UmengEvent; |
| 33 | 34 |
import ai.pai.client.views.ExitGroupConfirmPopup; |
| 34 | 35 |
import ai.pai.client.views.GroupExitPopup; |
@@ -134,7 +135,7 @@ public class GroupSettingActivity extends BaseActivity implements View.OnClickLi |
||
| 134 | 135 |
if (!isAdmin) {
|
| 135 | 136 |
new ExitGroupConfirmPopup(this,this).showPopupWindow(); |
| 136 | 137 |
} else {
|
| 137 |
- Toast.makeText(this, R.string.can_not_delete_self, Toast.LENGTH_SHORT).show(); |
|
| 138 |
+ ToastUtils.showShortToast(this,R.string.can_not_delete_self); |
|
| 138 | 139 |
} |
| 139 | 140 |
case R.id.tv_pop_cancel: |
| 140 | 141 |
exitPopup.dismiss(); |
@@ -175,16 +176,16 @@ public class GroupSettingActivity extends BaseActivity implements View.OnClickLi |
||
| 175 | 176 |
public void onCommandCommitFail(int command, String msg) {
|
| 176 | 177 |
switch (command) {
|
| 177 | 178 |
case GroupService.GroupCommand.COMMAND_FETCH_GROUP_INFO: |
| 178 |
- Toast.makeText(getApplicationContext(), R.string.group_detail_fetch_fail, Toast.LENGTH_SHORT).show(); |
|
| 179 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.group_detail_fetch_fail); |
|
| 179 | 180 |
break; |
| 180 | 181 |
case GroupService.GroupCommand.COMMAND_LOCK_GROUP: |
| 181 |
- Toast.makeText(getApplicationContext(), R.string.group_lock_fail, Toast.LENGTH_SHORT).show(); |
|
| 182 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.group_lock_fail); |
|
| 182 | 183 |
break; |
| 183 | 184 |
case GroupService.GroupCommand.COMMAND_UNLOCK_GROUP: |
| 184 |
- Toast.makeText(getApplicationContext(), R.string.group_unlock_fail, Toast.LENGTH_SHORT).show(); |
|
| 185 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.group_unlock_fail); |
|
| 185 | 186 |
break; |
| 186 | 187 |
case GroupService.GroupCommand.COMMAND_QUIT_GROUP: |
| 187 |
- Toast.makeText(getApplicationContext(), R.string.quit_group_fail, Toast.LENGTH_SHORT).show(); |
|
| 188 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.quit_group_fail); |
|
| 188 | 189 |
break; |
| 189 | 190 |
} |
| 190 | 191 |
} |
@@ -250,7 +251,7 @@ public class GroupSettingActivity extends BaseActivity implements View.OnClickLi |
||
| 250 | 251 |
groupLockToggleBtn.setChecked(false); |
| 251 | 252 |
groupLockTextView.setText(isLocked ? R.string.group_is_locked : R.string.group_is_unlocked); |
| 252 | 253 |
groupLockHintTextView.setText(isLocked ? R.string.group_locked_hint : R.string.group_unlocked_hint); |
| 253 |
- Toast.makeText(getApplicationContext(), R.string.group_is_unlocked, Toast.LENGTH_SHORT).show(); |
|
| 254 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.group_is_unlocked); |
|
| 254 | 255 |
break; |
| 255 | 256 |
case GroupService.GroupCommand.COMMAND_QUIT_GROUP: |
| 256 | 257 |
Toast.makeText(getApplicationContext(), R.string.quit_group_success, Toast.LENGTH_SHORT).show(); |
@@ -15,7 +15,6 @@ import android.view.ViewGroup; |
||
| 15 | 15 |
import android.view.ViewGroup.LayoutParams; |
| 16 | 16 |
import android.widget.ImageView; |
| 17 | 17 |
import android.widget.TextView; |
| 18 |
-import android.widget.Toast; |
|
| 19 | 18 |
|
| 20 | 19 |
import com.android.common.executors.ThreadExecutor; |
| 21 | 20 |
import com.android.common.utils.DeviceUtils; |
@@ -35,6 +34,7 @@ import java.util.Map; |
||
| 35 | 34 |
import ai.pai.client.R; |
| 36 | 35 |
import ai.pai.client.db.Preferences; |
| 37 | 36 |
import ai.pai.client.utils.HttpPostTask; |
| 37 |
+import ai.pai.client.utils.ToastUtils; |
|
| 38 | 38 |
import ai.pai.client.utils.UrlContainer; |
| 39 | 39 |
|
| 40 | 40 |
public class GuideActivity extends FragmentActivity implements OnPageChangeListener{
|
@@ -130,7 +130,7 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 130 | 130 |
toastMsg = getString(R.string.login_success); |
| 131 | 131 |
} |
| 132 | 132 |
Preferences.getInstance(context).setGuestLogin(true); |
| 133 |
- Toast.makeText(context,toastMsg, Toast.LENGTH_LONG).show(); |
|
| 133 |
+ ToastUtils.showShortToast(context,toastMsg); |
|
| 134 | 134 |
setResult(RESULT_OK); |
| 135 | 135 |
startActivity(new Intent(GuideActivity.this,MainActivity.class)); |
| 136 | 136 |
finish(); |
@@ -143,7 +143,7 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 143 | 143 |
if(TextUtils.isEmpty(toastMsg)){
|
| 144 | 144 |
toastMsg = getString(R.string.login_fail); |
| 145 | 145 |
} |
| 146 |
- Toast.makeText(context,toastMsg, Toast.LENGTH_LONG).show(); |
|
| 146 |
+ ToastUtils.showShortToast(context,toastMsg); |
|
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 | 149 |
}; |
@@ -182,7 +182,7 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 182 | 182 |
@Override |
| 183 | 183 |
public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
|
| 184 | 184 |
if(!isAuthComplete){
|
| 185 |
- Toast.makeText( getApplicationContext(), R.string.weixin_auth_success, Toast.LENGTH_SHORT).show(); |
|
| 185 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.weixin_auth_success); |
|
| 186 | 186 |
umShareAPI.getPlatformInfo(GuideActivity.this,platform,this); |
| 187 | 187 |
isAuthComplete = true; |
| 188 | 188 |
}else{
|
@@ -200,12 +200,12 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 200 | 200 |
|
| 201 | 201 |
@Override |
| 202 | 202 |
public void onError(SHARE_MEDIA platform, int action, Throwable t) {
|
| 203 |
- Toast.makeText( getApplicationContext(), R.string.weixin_auth_fail, Toast.LENGTH_SHORT).show(); |
|
| 203 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.weixin_auth_fail); |
|
| 204 | 204 |
} |
| 205 | 205 |
|
| 206 | 206 |
@Override |
| 207 | 207 |
public void onCancel(SHARE_MEDIA platform, int action) {
|
| 208 |
- Toast.makeText( getApplicationContext(), R.string.weixin_auth_fail, Toast.LENGTH_SHORT).show(); |
|
| 208 |
+ ToastUtils.showShortToast(getApplicationContext(), R.string.weixin_auth_fail); |
|
| 209 | 209 |
} |
| 210 | 210 |
}; |
| 211 | 211 |
|
@@ -270,7 +270,7 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 270 | 270 |
toastMsg = getString(R.string.login_success); |
| 271 | 271 |
} |
| 272 | 272 |
Preferences.getInstance(context).setGuestLogin(false); |
| 273 |
- Toast.makeText(context,toastMsg, Toast.LENGTH_LONG).show(); |
|
| 273 |
+ ToastUtils.showShortToast(context,toastMsg); |
|
| 274 | 274 |
setResult(RESULT_OK); |
| 275 | 275 |
startActivity(new Intent(GuideActivity.this,MainActivity.class)); |
| 276 | 276 |
finish(); |
@@ -283,7 +283,7 @@ public class GuideActivity extends FragmentActivity implements OnPageChangeListe |
||
| 283 | 283 |
if(TextUtils.isEmpty(toastMsg)){
|
| 284 | 284 |
toastMsg = getString(R.string.login_fail); |
| 285 | 285 |
} |
| 286 |
- Toast.makeText(context,toastMsg, Toast.LENGTH_LONG).show(); |
|
| 286 |
+ ToastUtils.showShortToast(context,toastMsg); |
|
| 287 | 287 |
} |
| 288 | 288 |
}; |
| 289 | 289 |
LoginTask.executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), UrlContainer.WX_AUTHORIZE_URL); |
@@ -24,7 +24,6 @@ import android.view.animation.CycleInterpolator; |
||
| 24 | 24 |
import android.widget.ImageButton; |
| 25 | 25 |
import android.widget.ImageView; |
| 26 | 26 |
import android.widget.TextView; |
| 27 |
-import android.widget.Toast; |
|
| 28 | 27 |
|
| 29 | 28 |
import com.android.common.utils.DeviceUtils; |
| 30 | 29 |
import com.android.common.utils.LogHelper; |
@@ -47,6 +46,7 @@ import ai.pai.client.services.GroupService; |
||
| 47 | 46 |
import ai.pai.client.services.MyLocationService; |
| 48 | 47 |
import ai.pai.client.utils.Constants; |
| 49 | 48 |
import ai.pai.client.utils.PhotoLoader; |
| 49 |
+import ai.pai.client.utils.ToastUtils; |
|
| 50 | 50 |
import ai.pai.client.utils.UmengEvent; |
| 51 | 51 |
import ai.pai.client.views.GatherInfoPopup; |
| 52 | 52 |
import ai.pai.client.views.GroupSelectPopup; |
@@ -148,7 +148,7 @@ public class MainActivity extends AppCompatActivity |
||
| 148 | 148 |
super.onBackPressed(); |
| 149 | 149 |
cleanTmpDirWhenExit(); |
| 150 | 150 |
}else{
|
| 151 |
- Toast.makeText(this,R.string.app_exit_hint,Toast.LENGTH_SHORT).show(); |
|
| 151 |
+ ToastUtils.showShortToast(this,R.string.app_exit_hint); |
|
| 152 | 152 |
} |
| 153 | 153 |
exitTime = System.currentTimeMillis(); |
| 154 | 154 |
} |
@@ -270,7 +270,7 @@ public class MainActivity extends AppCompatActivity |
||
| 270 | 270 |
bundle.putString("phone",phone);
|
| 271 | 271 |
intent.putExtras(bundle); |
| 272 | 272 |
startService(intent); |
| 273 |
- Toast.makeText(this, R.string.group_join_tip, Toast.LENGTH_SHORT).show(); |
|
| 273 |
+ ToastUtils.showShortToast(this, R.string.group_join_tip); |
|
| 274 | 274 |
} |
| 275 | 275 |
|
| 276 | 276 |
|
@@ -322,14 +322,14 @@ public class MainActivity extends AppCompatActivity |
||
| 322 | 322 |
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
| 323 | 323 |
if (resultCode == Activity.RESULT_OK) {
|
| 324 | 324 |
if (data == null || data.getStringExtra("info") == null) {
|
| 325 |
- Toast.makeText(this,R.string.scan_qr_wrong,Toast.LENGTH_SHORT).show(); |
|
| 325 |
+ ToastUtils.showShortToast(this, R.string.scan_qr_wrong); |
|
| 326 | 326 |
return; |
| 327 | 327 |
} |
| 328 | 328 |
|
| 329 | 329 |
String urlInfo = data.getStringExtra("info");
|
| 330 | 330 |
|
| 331 | 331 |
if(!urlInfo.contains("pai.ai")){
|
| 332 |
- Toast.makeText(this,R.string.scan_qr_wrong,Toast.LENGTH_SHORT).show(); |
|
| 332 |
+ ToastUtils.showShortToast(this, R.string.scan_qr_wrong); |
|
| 333 | 333 |
return; |
| 334 | 334 |
} |
| 335 | 335 |
LogHelper.d("czy","qr scan result = "+urlInfo);
|
@@ -370,7 +370,7 @@ public class MainActivity extends AppCompatActivity |
||
| 370 | 370 |
} |
| 371 | 371 |
intent.putExtras(bundle); |
| 372 | 372 |
startService(intent); |
| 373 |
- Toast.makeText(this, R.string.group_join_tip, Toast.LENGTH_SHORT).show(); |
|
| 373 |
+ ToastUtils.showShortToast(this, R.string.group_join_tip); |
|
| 374 | 374 |
} |
| 375 | 375 |
} |
| 376 | 376 |
} |
@@ -381,7 +381,7 @@ public class MainActivity extends AppCompatActivity |
||
| 381 | 381 |
if(TextUtils.isEmpty(msg)){
|
| 382 | 382 |
msg = getString(R.string.group_join_fail_tip); |
| 383 | 383 |
} |
| 384 |
- Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); |
|
| 384 |
+ ToastUtils.showShortToast(this,msg); |
|
| 385 | 385 |
} |
| 386 | 386 |
} |
| 387 | 387 |
|
@@ -10,10 +10,8 @@ import android.support.v7.widget.RecyclerView; |
||
| 10 | 10 |
import android.view.LayoutInflater; |
| 11 | 11 |
import android.view.View; |
| 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.JSONParseUtils; |
| 18 | 16 |
import com.android.views.swiperefreshrecyclerview.DividerItemDecoration; |
| 19 | 17 |
import com.android.views.swiperefreshrecyclerview.EndlessRecyclerOnScrollListener; |
@@ -31,7 +29,9 @@ import ai.pai.client.adapter.OrderListAdapter; |
||
| 31 | 29 |
import ai.pai.client.beans.GroupPhotoItem; |
| 32 | 30 |
import ai.pai.client.beans.OrderItem; |
| 33 | 31 |
import ai.pai.client.db.Preferences; |
| 32 |
+import ai.pai.client.utils.HttpPostTask; |
|
| 34 | 33 |
import ai.pai.client.utils.SystemUtils; |
| 34 |
+import ai.pai.client.utils.ToastUtils; |
|
| 35 | 35 |
import ai.pai.client.utils.UrlContainer; |
| 36 | 36 |
|
| 37 | 37 |
public class OrderListActivity extends BaseActivity implements View.OnClickListener,SwipeRefreshLayout.OnRefreshListener{
|
@@ -80,7 +80,7 @@ public class OrderListActivity extends BaseActivity implements View.OnClickListe |
||
| 80 | 80 |
loadMoreView.setVisibility(View.VISIBLE); |
| 81 | 81 |
doFetchOrdersTask(); |
| 82 | 82 |
}else{
|
| 83 |
- Toast.makeText(OrderListActivity.this,R.string.no_more_content,Toast.LENGTH_SHORT).show(); |
|
| 83 |
+ ToastUtils.showShortToast(OrderListActivity.this,R.string.no_more_content); |
|
| 84 | 84 |
} |
| 85 | 85 |
|
| 86 | 86 |
} |
@@ -178,7 +178,7 @@ public class OrderListActivity extends BaseActivity implements View.OnClickListe |
||
| 178 | 178 |
if(orderItems !=null && orderItems.size()>0){
|
| 179 | 179 |
orderAdapter.addOrderList(orderItems); |
| 180 | 180 |
}else{
|
| 181 |
- Toast.makeText(context,R.string.no_orders_found_tip,Toast.LENGTH_SHORT).show(); |
|
| 181 |
+ ToastUtils.showShortToast(context,R.string.no_orders_found_tip); |
|
| 182 | 182 |
} |
| 183 | 183 |
} |
| 184 | 184 |
}; |
@@ -10,7 +10,6 @@ import android.provider.MediaStore; |
||
| 10 | 10 |
import android.support.v4.view.ViewPager; |
| 11 | 11 |
import android.text.TextUtils; |
| 12 | 12 |
import android.view.View; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.android.common.executors.ThreadExecutor; |
| 16 | 15 |
import com.android.common.utils.JSONParseUtils; |
@@ -32,6 +31,7 @@ import ai.pai.client.adapter.FullScreenPhotoPageAdapter; |
||
| 32 | 31 |
import ai.pai.client.beans.GroupPhotoItem; |
| 33 | 32 |
import ai.pai.client.db.Preferences; |
| 34 | 33 |
import ai.pai.client.utils.HttpPostTask; |
| 34 |
+import ai.pai.client.utils.ToastUtils; |
|
| 35 | 35 |
import ai.pai.client.utils.UrlContainer; |
| 36 | 36 |
import ai.pai.client.views.HackyViewPager; |
| 37 | 37 |
|
@@ -75,12 +75,12 @@ public class PaidPhotoActivity extends BaseActivity implements View.OnClickListe |
||
| 75 | 75 |
break; |
| 76 | 76 |
case R.id.btn_download_full_screen: |
| 77 | 77 |
if(currentPhotoItem.photoFrom==1 && TextUtils.isEmpty(currentPhotoItem.mediumPhotoUrl) && TextUtils.isEmpty(currentPhotoItem.rawPhotoUrl)&&isPhotoInfoFetched){
|
| 78 |
- Toast.makeText(this,R.string.photo_need_buy,Toast.LENGTH_SHORT).show(); |
|
| 78 |
+ ToastUtils.showShortToast(this,R.string.photo_need_buy); |
|
| 79 | 79 |
return; |
| 80 | 80 |
} |
| 81 | 81 |
if(!isPhotoInfoFetched && TextUtils.isEmpty(currentPhotoItem.mediumPhotoUrl) && TextUtils.isEmpty(currentPhotoItem.rawPhotoUrl)){
|
| 82 | 82 |
doGetPhotoTask(); |
| 83 |
- Toast.makeText(this,R.string.photo_info_processing,Toast.LENGTH_SHORT).show(); |
|
| 83 |
+ ToastUtils.showShortToast(this,R.string.photo_info_processing); |
|
| 84 | 84 |
return; |
| 85 | 85 |
} |
| 86 | 86 |
|
@@ -191,7 +191,8 @@ public class PaidPhotoActivity extends BaseActivity implements View.OnClickListe |
||
| 191 | 191 |
@Override |
| 192 | 192 |
protected void onPreExecute() {
|
| 193 | 193 |
super.onPreExecute(); |
| 194 |
- Toast.makeText(context, R.string.save_photo_processing, Toast.LENGTH_SHORT).show(); |
|
| 194 |
+ |
|
| 195 |
+ ToastUtils.showShortToast(context, R.string.save_photo_processing); |
|
| 195 | 196 |
spinner.setVisibility(View.VISIBLE); |
| 196 | 197 |
spinner.startSpinning(); } |
| 197 | 198 |
|
@@ -239,14 +240,14 @@ public class PaidPhotoActivity extends BaseActivity implements View.OnClickListe |
||
| 239 | 240 |
spinner.stopSpinning(); |
| 240 | 241 |
spinner.setVisibility(View.GONE); |
| 241 | 242 |
if (result) {
|
| 242 |
- Toast.makeText(context, R.string.save_photo_success, Toast.LENGTH_SHORT).show(); |
|
| 243 |
+ ToastUtils.showShortToast(context, R.string.save_photo_success); |
|
| 243 | 244 |
try {
|
| 244 | 245 |
MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getPath(), name, name); |
| 245 | 246 |
} catch (Exception e) {
|
| 246 | 247 |
e.printStackTrace(); |
| 247 | 248 |
} |
| 248 | 249 |
} else {
|
| 249 |
- Toast.makeText(context, R.string.save_photo_fail, Toast.LENGTH_SHORT).show(); |
|
| 250 |
+ ToastUtils.showShortToast(context, R.string.save_photo_fail); |
|
| 250 | 251 |
} |
| 251 | 252 |
} |
| 252 | 253 |
} |
@@ -856,7 +856,6 @@ public class PhotoDetailsActivity extends BaseActivity implements View.OnClickLi |
||
| 856 | 856 |
@Override |
| 857 | 857 |
protected void onPostFail(Context context) {
|
| 858 | 858 |
super.onPostFail(context); |
| 859 |
-// Toast.makeText(getApplicationContext(), R.string.fetch_photo_comment_fail, Toast.LENGTH_SHORT).show(); |
|
| 860 | 859 |
} |
| 861 | 860 |
|
| 862 | 861 |
@Override |
@@ -921,7 +920,6 @@ public class PhotoDetailsActivity extends BaseActivity implements View.OnClickLi |
||
| 921 | 920 |
@Override |
| 922 | 921 |
protected void onPostFail(Context context) {
|
| 923 | 922 |
super.onPostFail(context); |
| 924 |
-// Toast.makeText(getApplicationContext(), R.string.fetch_photo_like_fail, Toast.LENGTH_SHORT).show(); |
|
| 925 | 923 |
} |
| 926 | 924 |
|
| 927 | 925 |
@Override |
@@ -10,7 +10,6 @@ import android.provider.MediaStore; |
||
| 10 | 10 |
import android.support.v4.view.ViewPager; |
| 11 | 11 |
import android.text.TextUtils; |
| 12 | 12 |
import android.view.View; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.android.common.executors.ThreadExecutor; |
| 16 | 15 |
import com.android.common.utils.LogHelper; |
@@ -35,6 +34,7 @@ import ai.pai.client.beans.GroupPhotoItem; |
||
| 35 | 34 |
import ai.pai.client.db.DBService; |
| 36 | 35 |
import ai.pai.client.db.Preferences; |
| 37 | 36 |
import ai.pai.client.utils.HttpPostTask; |
| 37 |
+import ai.pai.client.utils.ToastUtils; |
|
| 38 | 38 |
import ai.pai.client.utils.UmengEvent; |
| 39 | 39 |
import ai.pai.client.utils.UrlContainer; |
| 40 | 40 |
import ai.pai.client.views.HackyViewPager; |
@@ -84,7 +84,7 @@ public class PhotoFullScreenActivity extends BaseActivity implements View.OnClic |
||
| 84 | 84 |
case R.id.btn_download_full_screen: |
| 85 | 85 |
MobclickAgent.onEvent(this, UmengEvent.fullscreen_download_btn_click); |
| 86 | 86 |
if(currentPhotoItem.photoFrom==1 && TextUtils.isEmpty(currentPhotoItem.mediumPhotoUrl) && TextUtils.isEmpty(currentPhotoItem.rawPhotoUrl)){
|
| 87 |
- Toast.makeText(this,R.string.photo_need_buy,Toast.LENGTH_SHORT).show(); |
|
| 87 |
+ ToastUtils.showShortToast(this,R.string.photo_need_buy); |
|
| 88 | 88 |
return; |
| 89 | 89 |
} |
| 90 | 90 |
if(savePhotoTask!=null && savePhotoTask.getStatus()== AsyncTask.Status.RUNNING){
|
@@ -111,7 +111,7 @@ public class PhotoFullScreenActivity extends BaseActivity implements View.OnClic |
||
| 111 | 111 |
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
| 112 | 112 |
if(position==photoList.size()-1){
|
| 113 | 113 |
if(fetchPhotosTask!=null && fetchPhotosTask.getStatus()== AsyncTask.Status.RUNNING){
|
| 114 |
- Toast.makeText(this,R.string.please_wait,Toast.LENGTH_SHORT).show(); |
|
| 114 |
+ ToastUtils.showShortToast(this,R.string.please_wait); |
|
| 115 | 115 |
} |
| 116 | 116 |
} |
| 117 | 117 |
} |
@@ -225,7 +225,7 @@ public class PhotoFullScreenActivity extends BaseActivity implements View.OnClic |
||
| 225 | 225 |
@Override |
| 226 | 226 |
protected void onPreExecute() {
|
| 227 | 227 |
super.onPreExecute(); |
| 228 |
- Toast.makeText(context, R.string.save_photo_processing, Toast.LENGTH_SHORT).show(); |
|
| 228 |
+ ToastUtils.showShortToast(context, R.string.save_photo_processing); |
|
| 229 | 229 |
spinner.setVisibility(View.VISIBLE); |
| 230 | 230 |
spinner.startSpinning(); } |
| 231 | 231 |
|
@@ -279,7 +279,7 @@ public class PhotoFullScreenActivity extends BaseActivity implements View.OnClic |
||
| 279 | 279 |
spinner.stopSpinning(); |
| 280 | 280 |
spinner.setVisibility(View.GONE); |
| 281 | 281 |
if (result) {
|
| 282 |
- Toast.makeText(context, R.string.save_photo_success, Toast.LENGTH_SHORT).show(); |
|
| 282 |
+ ToastUtils.showShortToast(context, R.string.save_photo_success); |
|
| 283 | 283 |
try {
|
| 284 | 284 |
MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getPath(), name, name); |
| 285 | 285 |
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); |
@@ -290,7 +290,7 @@ public class PhotoFullScreenActivity extends BaseActivity implements View.OnClic |
||
| 290 | 290 |
e.printStackTrace(); |
| 291 | 291 |
} |
| 292 | 292 |
} else {
|
| 293 |
- Toast.makeText(context, R.string.save_photo_fail, Toast.LENGTH_SHORT).show(); |
|
| 293 |
+ ToastUtils.showShortToast(context, R.string.save_photo_fail); |
|
| 294 | 294 |
} |
| 295 | 295 |
} |
| 296 | 296 |
} |
@@ -8,7 +8,6 @@ import android.support.v4.app.FragmentPagerAdapter; |
||
| 8 | 8 |
import android.support.v4.view.ViewPager; |
| 9 | 9 |
import android.view.View; |
| 10 | 10 |
import android.widget.TextView; |
| 11 |
-import android.widget.Toast; |
|
| 12 | 11 |
|
| 13 | 12 |
import com.android.views.tabstrip.PagerSlidingTabStrip; |
| 14 | 13 |
|
@@ -23,6 +22,7 @@ import ai.pai.client.utils.FileUtils; |
||
| 23 | 22 |
import ai.pai.client.utils.ImageUtils; |
| 24 | 23 |
import ai.pai.client.utils.StringUtils; |
| 25 | 24 |
import ai.pai.client.utils.SystemUtils; |
| 25 |
+import ai.pai.client.utils.ToastUtils; |
|
| 26 | 26 |
|
| 27 | 27 |
public class PhotoGalleryActivity extends FragmentActivity{
|
| 28 | 28 |
|
@@ -50,7 +50,7 @@ public class PhotoGalleryActivity extends FragmentActivity{
|
||
| 50 | 50 |
tab = (PagerSlidingTabStrip)findViewById(R.id.indicator); |
| 51 | 51 |
albums = ImageUtils.findGalleries(this, paths); |
| 52 | 52 |
if(albums.isEmpty()){
|
| 53 |
- Toast.makeText(this,R.string.no_photo_found, Toast.LENGTH_LONG).show(); |
|
| 53 |
+ ToastUtils.showShortToast(this,R.string.no_photo_found); |
|
| 54 | 54 |
return; |
| 55 | 55 |
} |
| 56 | 56 |
pagerAdapter = new TabPageIndicatorAdapter(getSupportFragmentManager()); |
@@ -10,7 +10,6 @@ import android.view.View; |
||
| 10 | 10 |
import android.view.ViewGroup; |
| 11 | 11 |
import android.widget.Button; |
| 12 | 12 |
import android.widget.ImageView; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.android.common.utils.NetworkUtil; |
| 16 | 15 |
import com.android.views.progressbar.ProgressWheel; |
@@ -24,6 +23,7 @@ import ai.pai.client.R; |
||
| 24 | 23 |
import ai.pai.client.activity.PhotoFullScreenActivity; |
| 25 | 24 |
import ai.pai.client.beans.GroupPhotoItem; |
| 26 | 25 |
import ai.pai.client.utils.PhotoLoader; |
| 26 |
+import ai.pai.client.utils.ToastUtils; |
|
| 27 | 27 |
|
| 28 | 28 |
/** |
| 29 | 29 |
* Created by chengzhenyu on 2015/12/11. |
@@ -102,7 +102,7 @@ public class DetailPhotoPageAdapter extends PagerAdapter {
|
||
| 102 | 102 |
|
| 103 | 103 |
@Override |
| 104 | 104 |
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
|
| 105 |
- Toast.makeText(view.getContext(), R.string.photo_load_fail, Toast.LENGTH_SHORT).show(); |
|
| 105 |
+ ToastUtils.showShortToast(view.getContext(), R.string.photo_load_fail); |
|
| 106 | 106 |
spinner.stopSpinning(); |
| 107 | 107 |
spinner.setVisibility(View.GONE); |
| 108 | 108 |
reloadBtn.setVisibility(View.VISIBLE); |
@@ -10,7 +10,6 @@ import android.view.View; |
||
| 10 | 10 |
import android.view.ViewGroup; |
| 11 | 11 |
import android.widget.ImageView; |
| 12 | 12 |
import android.widget.TextView; |
| 13 |
-import android.widget.Toast; |
|
| 14 | 13 |
|
| 15 | 14 |
import com.nostra13.universalimageloader.core.DisplayImageOptions; |
| 16 | 15 |
|
@@ -21,6 +20,7 @@ import ai.pai.client.beans.GroupMemberInfo; |
||
| 21 | 20 |
import ai.pai.client.db.Preferences; |
| 22 | 21 |
import ai.pai.client.services.GroupService; |
| 23 | 22 |
import ai.pai.client.utils.PhotoLoader; |
| 23 |
+import ai.pai.client.utils.ToastUtils; |
|
| 24 | 24 |
import ai.pai.client.views.DeleteConfirmPopup; |
| 25 | 25 |
|
| 26 | 26 |
public class GroupMemberAdapter extends RecyclerView.Adapter<GroupMemberAdapter.MemberViewHolder> implements View.OnClickListener{
|
@@ -70,7 +70,7 @@ public class GroupMemberAdapter extends RecyclerView.Adapter<GroupMemberAdapter. |
||
| 70 | 70 |
@Override |
| 71 | 71 |
public void onClick(View v) {
|
| 72 | 72 |
if(adminId.equals(info.userId)){
|
| 73 |
- Toast.makeText(context,R.string.can_not_delete_self,Toast.LENGTH_SHORT).show(); |
|
| 73 |
+ ToastUtils.showShortToast(context,R.string.can_not_delete_self); |
|
| 74 | 74 |
return; |
| 75 | 75 |
} |
| 76 | 76 |
selectedMemberInfo = info; |
@@ -95,7 +95,7 @@ public class GroupMemberAdapter extends RecyclerView.Adapter<GroupMemberAdapter. |
||
| 95 | 95 |
bundle.putString("admin_id",adminId);
|
| 96 | 96 |
intent.putExtras(bundle); |
| 97 | 97 |
context.startService(intent); |
| 98 |
- Toast.makeText(context,R.string.delete_member_processing,Toast.LENGTH_SHORT).show(); |
|
| 98 |
+ ToastUtils.showShortToast(context,R.string.delete_member_processing); |
|
| 99 | 99 |
int position = memberList.indexOf(selectedMemberInfo); |
| 100 | 100 |
memberList.remove(position); |
| 101 | 101 |
notifyItemRemoved(position); |
@@ -8,7 +8,6 @@ import android.view.View; |
||
| 8 | 8 |
import android.view.ViewGroup; |
| 9 | 9 |
import android.widget.ImageView; |
| 10 | 10 |
import android.widget.TextView; |
| 11 |
-import android.widget.Toast; |
|
| 12 | 11 |
|
| 13 | 12 |
import com.android.common.utils.TimeUtils; |
| 14 | 13 |
import com.android.views.swipeLayout.SwipeLayout; |
@@ -21,6 +20,7 @@ import ai.pai.client.beans.GroupInfo; |
||
| 21 | 20 |
import ai.pai.client.db.DBService; |
| 22 | 21 |
import ai.pai.client.db.Preferences; |
| 23 | 22 |
import ai.pai.client.utils.GroupCreateUtils; |
| 23 |
+import ai.pai.client.utils.ToastUtils; |
|
| 24 | 24 |
|
| 25 | 25 |
public class HistoryGroupAdapter extends RecyclerView.Adapter<HistoryGroupAdapter.GroupViewHolder> {
|
| 26 | 26 |
|
@@ -77,11 +77,11 @@ public class HistoryGroupAdapter extends RecyclerView.Adapter<HistoryGroupAdapte |
||
| 77 | 77 |
public void onClick(View v) {
|
| 78 | 78 |
try{
|
| 79 | 79 |
if(info.groupPhotoNum>0){
|
| 80 |
- Toast.makeText(context,R.string.group_photo_not_null,Toast.LENGTH_SHORT).show(); |
|
| 80 |
+ ToastUtils.showShortToast(context,R.string.group_photo_not_null); |
|
| 81 | 81 |
return; |
| 82 | 82 |
} |
| 83 | 83 |
if(!info.adminId.equals(Preferences.getInstance(context).getUserId())){
|
| 84 |
- Toast.makeText(context,R.string.group_admin_not_me,Toast.LENGTH_SHORT).show(); |
|
| 84 |
+ ToastUtils.showShortToast(context,R.string.group_admin_not_me); |
|
| 85 | 85 |
return; |
| 86 | 86 |
} |
| 87 | 87 |
|
@@ -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 |
} |