diff --git a/readme.txt b/readme.txt index 0758d62..de12ed2 100644 --- a/readme.txt +++ b/readme.txt @@ -20,3 +20,4 @@ 10.新闻界面最终版修改 9:41 2016/8/30 +?. 许家铭修正SonarQube 9:26 2016/9/2 \ No newline at end of file diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/MessageDef.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/MessageDef.class index 22f75d6..98fa6a1 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/MessageDef.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/MessageDef.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/TypeDef.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/TypeDef.class index 78e9dd7..d5032e0 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/TypeDef.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/date/TypeDef.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class index 1a39dc8..dc95543 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class index 24c98bd..2fd4eb3 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class index c448f67..1aa8a30 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class index 4649d59..6cade13 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class index ffeddd6..38fbb96 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class index b43b580..766d9da 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter.class index 43a0354..72596e4 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/adapter/AIContentAdapter.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$2.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$2.class index 9cf2561..c1e77aa 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$2.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$2.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$3.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$3.class index 9c65419..0249924 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$3.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$3.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4$1.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4$1.class index 2f40aa5..06303a1 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4$1.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4$1.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4.class index c68d858..d1be68b 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$4.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class index 035a1cb..804652c 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity.class index 98bc9a6..a665158 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/LoginActivity.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MainActivity.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MainActivity.class index 209927e..8fce8c5 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MainActivity.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MainActivity.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MultiViewGroup.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MultiViewGroup.class index 904337f..7e42b82 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MultiViewGroup.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/MultiViewGroup.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopActivity.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopActivity.class index 34ede83..de7e7ad 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopActivity.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopActivity.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopItemActivity.class b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopItemActivity.class index 8e00dcb..b450482 100644 Binary files a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopItemActivity.class and b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/bin/classes/com/stone/shop/view/ShopItemActivity.class differ diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/MessageDef.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/MessageDef.java index a230ac3..59cc459 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/MessageDef.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/MessageDef.java @@ -1,8 +1,15 @@ package com.stone.date; +import android.util.Log; + public class MessageDef { - + + //SonarQube fix by XCP 2016-9-2 + private void dosomething(){ + Log.i("Why define this method:"," I don't know"); + } + //鏌ヨ鐢ㄦ埛璁㈠崟鎴愬姛瀹屾垚 public static final int MINE_FINISH_LOAD_DATA = 401; diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/TypeDef.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/TypeDef.java index 4cd2403..ba68ac7 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/TypeDef.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/date/TypeDef.java @@ -1,5 +1,7 @@ package com.stone.date; +import android.util.Log; + /** * 绫诲瀷鍒嗙被姹囨 * @@ -7,6 +9,11 @@ package com.stone.date; * @author Stone */ public class TypeDef { + + //SonarQube fix by XCP 2016-9-2 + private void dosomething(){ + Log.i("Why define this method:"," I don't know"); + } //鐖跺垎绫 public static final String[] typeDadList = { "瀛︿範", "鐐归", "鏍″洯鏈嶅姟", "濞变箰" }; diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/adapter/AIContentAdapter.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/adapter/AIContentAdapter.java index 7a56ed5..01a6fc8 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/adapter/AIContentAdapter.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/adapter/AIContentAdapter.java @@ -3,7 +3,6 @@ package com.stone.shop.adapter; import java.util.List; import com.stone.shop.R; -import com.stone.shop.model.Constant; import com.stone.shop.model.Discuss; import com.stone.shop.view.CommentActivity; import com.stone.util.ActivityUtil; @@ -24,8 +23,8 @@ public class AIContentAdapter extends BaseContentAdapter { public static final int SAVE_FAVOURITE = 2; public AIContentAdapter(Context context, List list) { - super(context, list); // TODO Auto-generated constructor stub + super(context, list); } @Override diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/LoginActivity.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/LoginActivity.java index 0a298e9..7999f8f 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/LoginActivity.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/LoginActivity.java @@ -144,32 +144,7 @@ public class LoginActivity extends Activity implements OnClickListener { switch (v.getId()) { // 鐧婚檰 case R.id.btn_login: - username = etUsername.getText().toString(); - password = etPassword.getText().toString(); - if (!Util.isNetworkConnected(this)) { - toast("鏈ㄦ湁缃戠粶 ( 鈯 o 鈯 ) "); - } else if ("".equals(username) || "".equals(password)) { - toast("璇疯緭鍏ヨ处鍙峰拰瀵嗙爜"); - break; - } else { - final User bu2 = new User(); - bu2.setUsername(username); - bu2.setPassword(password); - bu2.login(this, new SaveListener() { - @Override - public void onSuccess() { - toast("娆㈣繋杩涘叆 鍦ㄨ繖閲 鏈嶅姟绯荤粺"); - saveUserInfo(username, password); // 淇濆瓨鐢ㄦ埛淇℃伅 - User.userId = bu2.getObjectId(); // 璺宠浆鍒颁富椤 - Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); - startActivity(toHome); - finish();} - @Override - public void onFailure(int arg0, String arg1) { - toast("鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒"); - } - }); - } + case_fun(); break; case R.id.btn_register: Intent toReg = new Intent(LoginActivity.this, RegisterActivity.class); @@ -182,6 +157,42 @@ public class LoginActivity extends Activity implements OnClickListener { break; } } + + /** + * SonarQube fix + * @author XCP + * @date 2016-9-2 + */ + public void case_fun(){ + + username = etUsername.getText().toString(); + password = etPassword.getText().toString(); + if (!Util.isNetworkConnected(this)) { + toast("鏈ㄦ湁缃戠粶 ( 鈯 o 鈯 ) "); + } else if ("".equals(username) || "".equals(password)) { + toast("璇疯緭鍏ヨ处鍙峰拰瀵嗙爜"); + return ; + } else { + final User bu2 = new User(); + bu2.setUsername(username); + bu2.setPassword(password); + bu2.login(this, new SaveListener() { + @Override + public void onSuccess() { + toast("娆㈣繋杩涘叆 鍦ㄨ繖閲 鏈嶅姟绯荤粺"); + saveUserInfo(username, password); // 淇濆瓨鐢ㄦ埛淇℃伅 + User.userId = bu2.getObjectId(); // 璺宠浆鍒颁富椤 + Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); + startActivity(toHome); + finish();} + @Override + public void onFailure(int arg0, String arg1) { + toast("鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒"); + } + }); + } + } + public void toast(String toast) { Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); } diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MainActivity.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MainActivity.java index 23c925d..a0e48ce 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MainActivity.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MainActivity.java @@ -4,6 +4,7 @@ import com.stone.shop.R; import android.app.Activity; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; @@ -38,14 +39,16 @@ public class MainActivity extends Activity implements OnClickListener { tv.scrollBy(20, 0); int tvscrllX = tv.getScrollX(); int tvscrllY = tv.getScrollY(); - System.out.println( " tvscrllX ---> " + tvscrllX + " --- tvscrllY ---> "+tvscrllY); + //System.out.println( " tvscrllX ---> " + tvscrllX + " --- tvscrllY ---> "+tvscrllY); + Log.i("this is:", " tvscrllX ---> " + tvscrllX + " --- tvscrllY ---> "+tvscrllY);//SonarQube fix by XCP 2016-9-2 bt_scrollLeft.scrollBy(20, 0); break; case R.id.bt_scrollRight: tv.scrollTo(-100, 0); int tvscrllXx = tv.getScrollX(); int tvscrllYx = tv.getScrollY(); - System.out.println( " tvscrllX ---> " + tvscrllXx + " --- tvscrllY ---> "+tvscrllYx); + //System.out.println( " tvscrllX ---> " + tvscrllXx + " --- tvscrllY ---> "+tvscrllYx); + Log.i("this is:", " tvscrllX ---> " + tvscrllXx + " --- tvscrllY ---> "+tvscrllYx);//SonarQube fix by XCP 2016-9-2 break; default: break; diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MultiViewGroup.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MultiViewGroup.java index 7ed1113..00b3bd7 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MultiViewGroup.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/MultiViewGroup.java @@ -177,32 +177,7 @@ public class MultiViewGroup extends ViewGroup { mLastionMotionX = x ; break ; case MotionEvent.ACTION_UP: - final VelocityTracker velocityTracker = mVelocityTracker ; - velocityTracker.computeCurrentVelocity(1000); - int velocityX = (int) velocityTracker.getXVelocity() ; - Log.e(TAG , "---velocityX---" + velocityX); - //婊戝姩閫熺巼杈惧埌浜嗕竴涓爣鍑(蹇熷悜鍙虫粦灞忥紝杩斿洖涓婁竴涓睆骞) 椹笂杩涜鍒囧睆澶勭悊 - if (velocityX > SNAP_VELOCITY && curScreen > 0) { - // Fling enough to move left - Log.e(TAG, "snap left"); - snapToScreen(curScreen - 1); - } - //蹇熷悜宸︽粦灞忥紝杩斿洖涓嬩竴涓睆骞) - else if(velocityX < -SNAP_VELOCITY && curScreen < (getChildCount()-1)){ - Log.e(TAG, "snap right"); - snapToScreen(curScreen + 1); - } - //浠ヤ笂涓哄揩閫熺Щ鍔ㄧ殑 锛屽己鍒跺垏鎹㈠睆骞 - else{ - //鎴戜滑鏄紦鎱㈢Щ鍔ㄧ殑锛屽洜姝ゅ厛鍒ゆ柇鏄繚鐣欏湪鏈睆骞曡繕鏄埌涓嬩竴灞忓箷 - snapToDestination(); - } - - if (mVelocityTracker != null) { - mVelocityTracker.recycle(); - mVelocityTracker = null; - } - mTouchState = TOUCH_STATE_REST ; + case_fun(); break; case MotionEvent.ACTION_CANCEL: mTouchState = TOUCH_STATE_REST ; @@ -212,6 +187,41 @@ public class MultiViewGroup extends ViewGroup { } return true ; } + + /** + * SonarQube fix + * @author XCP + * @date 2016-9-2 + */ + public void case_fun(){ + final VelocityTracker velocityTracker = mVelocityTracker ; + velocityTracker.computeCurrentVelocity(1000); + int velocityX = (int) velocityTracker.getXVelocity() ; + Log.e(TAG , "---velocityX---" + velocityX); + //婊戝姩閫熺巼杈惧埌浜嗕竴涓爣鍑(蹇熷悜鍙虫粦灞忥紝杩斿洖涓婁竴涓睆骞) 椹笂杩涜鍒囧睆澶勭悊 + if (velocityX > SNAP_VELOCITY && curScreen > 0) { + // Fling enough to move left + Log.e(TAG, "snap left"); + snapToScreen(curScreen - 1); + } + //蹇熷悜宸︽粦灞忥紝杩斿洖涓嬩竴涓睆骞) + else if(velocityX < -SNAP_VELOCITY && curScreen < (getChildCount()-1)){ + Log.e(TAG, "snap right"); + snapToScreen(curScreen + 1); + } + //浠ヤ笂涓哄揩閫熺Щ鍔ㄧ殑 锛屽己鍒跺垏鎹㈠睆骞 + else{ + //鎴戜滑鏄紦鎱㈢Щ鍔ㄧ殑锛屽洜姝ゅ厛鍒ゆ柇鏄繚鐣欏湪鏈睆骞曡繕鏄埌涓嬩竴灞忓箷 + snapToDestination(); + } + + if (mVelocityTracker != null) { + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + mTouchState = TOUCH_STATE_REST ; + } + ////鎴戜滑鏄紦鎱㈢Щ鍔ㄧ殑 private void snapToDestination(){ //褰撳墠鐨勫亸绉讳綅缃 diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopActivity.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopActivity.java index 7c89d8b..973072c 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopActivity.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopActivity.java @@ -64,20 +64,7 @@ public class ShopActivity extends Activity implements OnItemClickListener{ //鐐瑰嚮 瀛︿範灏忚彍 涓殑瀛愰」锛1浠h〃绗竴涓狦ridView, (position+1)浠h〃GridView涓鍑犱釜鍏冪礌锛 case R.id.gv_school_class: - //鏁欏绫荤殑鍋氱壒鍒鐞 - if(position==2) { - Intent toInformationActivity = new Intent(ShopActivity.this,InformationActivity.class); - startActivity(toInformationActivity); - } - if(position==1) { - Intent toBXTActivity = new Intent(ShopActivity.this,LibraryActivity.class); - startActivity(toBXTActivity); - } - if(position==0) { - Intent toBXTActivity = new Intent(ShopActivity.this, ClassroomActivity.class); - startActivity(toBXTActivity); - } - + case_fun(position); break; //鐐瑰嚮 鍚冮キ灏忚彍 涓殑瀛愰」 case R.id.gv_food_class: @@ -99,6 +86,29 @@ public class ShopActivity extends Activity implements OnItemClickListener{ } } + /** + * SonarQube fix + * @author XCP + * @param position + * @date 2016-9-2 + */ + public void case_fun(int position){ + //鏁欏绫荤殑鍋氱壒鍒鐞 + if(position==2) { + Intent toInformationActivity = new Intent(ShopActivity.this,InformationActivity.class); + startActivity(toInformationActivity); + } + if(position==1) { + Intent toBXTActivity = new Intent(ShopActivity.this,LibraryActivity.class); + startActivity(toBXTActivity); + } + if(position==0) { + Intent toBXTActivity = new Intent(ShopActivity.this, ClassroomActivity.class); + startActivity(toBXTActivity); + } + + } + private void toast(String toast) { Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); } diff --git a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopItemActivity.java b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopItemActivity.java index 4f6d7c4..a8fc390 100644 --- a/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopItemActivity.java +++ b/浠g爜/鍦ㄨ繖閲3.0_鏈缁堢増/src/com/stone/shop/view/ShopItemActivity.java @@ -204,15 +204,7 @@ public class ShopItemActivity extends Activity implements OnClickListener, OnIte public void onClick(View v) { switch (v.getId()) { case R.id.btn_commit: - if ("".equals(etCommit.getText().toString())) {toast("浜诧紝鍏堝啓涓鍙ュ惂");} - else { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy骞碝M鏈坉d鏃 HH:mm:ss "); - Date curDate = new Date(System.currentTimeMillis());// 鑾峰彇褰撳墠鏃堕棿 - String time = formatter.format(curDate); - String content = etCommit.getText().toString() + " [ " + time+ " ] "; - insertCommit("admin" + ":", content); - etCommit.setText(""); - } + case_fun_1(); break; case R.id.img_call: toast("搴椾富娌℃湁鐣欎笅鐢佃瘽"); @@ -227,16 +219,7 @@ public class ShopItemActivity extends Activity implements OnClickListener, OnIte long id) { switch (viewPager.getCurrentItem()) { case 0: - toast("閫夋嫨鐨勫晢鍝佸悕绉帮細 " + goodsList.get(position).getName()); - selectGood = goodsList.get(position); - toast("鐐瑰嚮浜嗚喘涔版寜閽"); - Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shop ); - bundle.putSerializable("good", selectGood); - bundle.putString("shopID", shopID); //鍟嗛摵鐨処D闇瑕佸崟鐙紶閫,鍚﹀垯鑾峰彇鍒扮殑鏄痭ull - toOrderActivity.putExtras(bundle); - startActivity(toOrderActivity); + case_fun_2(position); break; case 1: break; @@ -245,6 +228,47 @@ public class ShopItemActivity extends Activity implements OnClickListener, OnIte } } + + /** + * SonarQube fix + * @date 2016-9-2 + * @author XCP + */ + + public void case_fun_1(){ + + if ("".equals(etCommit.getText().toString())) {toast("浜诧紝鍏堝啓涓鍙ュ惂");} + else { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy骞碝M鏈坉d鏃 HH:mm:ss "); + Date curDate = new Date(System.currentTimeMillis());// 鑾峰彇褰撳墠鏃堕棿 + String time = formatter.format(curDate); + String content = etCommit.getText().toString() + " [ " + time+ " ] "; + insertCommit("admin" + ":", content); + etCommit.setText(""); + } + } + + /** + * SonarQube fix + * @date 2016-9-2 + * @author XCP + * @param position + */ + + public void case_fun_2(int position){ + + toast("閫夋嫨鐨勫晢鍝佸悕绉帮細 " + goodsList.get(position).getName()); + selectGood = goodsList.get(position); + toast("鐐瑰嚮浜嗚喘涔版寜閽"); + Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); + Bundle bundle = new Bundle(); + bundle.putSerializable("shop", shop ); + bundle.putSerializable("good", selectGood); + bundle.putString("shopID", shopID); //鍟嗛摵鐨処D闇瑕佸崟鐙紶閫,鍚﹀垯鑾峰彇鍒扮殑鏄痭ull + toOrderActivity.putExtras(bundle); + startActivity(toOrderActivity); + } + public void toast(String toast) { Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); }