Merge branch 'qinjiaming_branch'。

This commit is contained in:
qinjiaming_branch 2016-08-26 09:04:24 +08:00
commit 13339e5d09
31 changed files with 35 additions and 63 deletions

BIN
~$$顺序图.~vsdx Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Binary file not shown.

View File

@ -1,15 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-20
proguard.config=proguard.cfg

View File

@ -8,7 +8,6 @@ import com.stone.shop.model.News;
import android.R.integer;
import android.content.Context;
import android.graphics.pdf.PdfDocument.Page;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -77,7 +77,7 @@ public class LibraryActivity extends Activity implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(LibraryActivity.this, ReservationActivity.class);
Intent intent = new Intent(LibraryActivity.this, LibraryReservationActivity.class);
Classroom classroom = mBXTNewsList.get(position);
intent.putExtra("roomId", classroom.getObjectId());
intent.putExtra("roomName", classroom.getName());

View File

@ -42,7 +42,7 @@ public class LibraryReservationActivity extends Activity {
final String roomId = getIntent().getStringExtra("roomId");
final String roomName = getIntent().getStringExtra("roomName");
TextView tvRoom = (TextView) findViewById(R.id.tv_room);
TextView tvRoom = (TextView) findViewById(R.id.textView1);
tvRoom.setText("研修室:" + roomName);
btnLogin = (Button) findViewById(R.id.btn_login);
@ -59,7 +59,7 @@ public class LibraryReservationActivity extends Activity {
if (!newsList.isEmpty()) {
String dateTime = newsList.get(0).getDateTime();
Logger logger = Logger.getLogger("lavasoft");
try {
if (dateFormat.parse(dateTime).before(new Date())) {
@ -72,6 +72,7 @@ public class LibraryReservationActivity extends Activity {
}
} catch (ParseException e) {
// TODO
Logger logger = Logger.getLogger("lavasoft");
logger.log(Level.SEVERE, "something may be wrong", e);
}
}

View File

@ -1,9 +1,5 @@
package com.stone.shop.view;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONException;
import org.json.JSONObject;
@ -13,8 +9,8 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import java.util.logging.Level;
import java.util.logging.Logger;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@ -35,7 +31,6 @@ import com.stone.shop.R;
import com.stone.shop.model.User;
import com.stone.util.Util;
import com.tencent.connect.UserInfo;
import com.tencent.connect.auth.QQAuth;
import com.tencent.connect.common.Constants;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
@ -64,34 +59,28 @@ public class LoginActivity extends Activity implements OnClickListener {
private TextView mUserInfo;
private ImageView mUserLogo;
private ImageView mNewLoginButton;
private TextView backInfo;
// QQ登陆
private static Tencent mTencent;
// private QQAuth mQQAuth;
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (msg.what == 0) {
JSONObject response = (JSONObject) msg.obj;
if (response.has("nickname")) {
try {
mUserInfo.setVisibility(android.view.View.VISIBLE);
try {mUserInfo.setVisibility(android.view.View.VISIBLE);
mUserInfo.setText(response.getString("nickname"));
} catch (JSONException e) {
e.printStackTrace();
}
Logger logger = Logger.getLogger("lavasoft");
logger.log(Level.SEVERE, "something may be wrong", e);}
}
} else if (msg.what == 1) {
Bitmap bitmap = (Bitmap) msg.obj;
mUserLogo.setImageBitmap(bitmap);
mUserLogo.setVisibility(android.view.View.VISIBLE);
}
}
};
@Override
@ -103,8 +92,6 @@ public class LoginActivity extends Activity implements OnClickListener {
setContentView(R.layout.activity_login);
// QQ登陆, 获取实例
// mQQAuth = QQAuth.createInstance(APP_ID,
// this.getApplicationContext());
mTencent = Tencent.createInstance(APP_ID, this.getApplicationContext());
btnLogin = (Button) findViewById(R.id.btn_login);
@ -122,16 +109,21 @@ public class LoginActivity extends Activity implements OnClickListener {
mUserLogo = (ImageView) findViewById(R.id.user_logo);
mNewLoginButton = (ImageView) findViewById(R.id.new_login_btn);
mNewLoginButton.setOnClickListener(this);
backInfo = (TextView) findViewById(R.id.user_callback);
getUserInfo();
}
public String getusername()
{
return username;
}
public String getpassword()
{
return password;
}
private void getUserInfo() {
SharedPreferences sp = getSharedPreferences("UserInfo", 0);
etUsername.setText(sp.getString("username", null));
etPassword.setText(sp.getString("password", null));
etUsername.setText(sp.getString(getusername(), null));
etPassword.setText(sp.getString(getpassword(), null));
}
// 保存用户的登陆记录
@ -164,7 +156,7 @@ public class LoginActivity extends Activity implements OnClickListener {
if (!Util.isNetworkConnected(this)) {
toast("木有网络 ( ⊙ o ⊙ ) ");
} else if (username.equals("") || password.equals("")) {
} else if ("".equals(username) || "".equals(password)) {
toast("请输入账号和密码");
break;
} else {
@ -175,7 +167,7 @@ public class LoginActivity extends Activity implements OnClickListener {
@Override
public void onSuccess() {
// TODO Auto-generated method stub
// TODO
toast("欢迎进入 在这里 服务系统");
// 保存用户信息
saveUserInfo(username, password);
@ -188,7 +180,7 @@ public class LoginActivity extends Activity implements OnClickListener {
@Override
public void onFailure(int arg0, String arg1) {
// TODO Auto-generated method stub
// TODO
toast("用户名或密码错误");
}
});
@ -233,18 +225,18 @@ public class LoginActivity extends Activity implements OnClickListener {
return;
}
JSONObject jsonResponse = (JSONObject) response;
if (null != jsonResponse && jsonResponse.length() == 0) {
if (jsonResponse.length() == 0) {
Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败");
return;
}
// Util.showResultDialog(LoginActivity.this, response.toString(),
// "登录成功");
doComplete((JSONObject) response);
try {
User.userId = jsonResponse.getString("openid");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// TODO
Logger logger = Logger.getLogger("lavasoft");
logger.log(Level.SEVERE, "something may be wrong", e);
}
Intent toHome = new Intent(LoginActivity.this, BaseActivity.class);
@ -253,7 +245,7 @@ public class LoginActivity extends Activity implements OnClickListener {
}
protected void doComplete(JSONObject values) {
//do nothing
}
@Override
@ -275,7 +267,7 @@ public class LoginActivity extends Activity implements OnClickListener {
@Override
public void onError(UiError e) {
//do nothing
}
@Override
@ -294,7 +286,8 @@ public class LoginActivity extends Activity implements OnClickListener {
try {
bitmap = Util.getbitmap(json.getString("figureurl_qq_2"));
} catch (JSONException e) {
Logger logger = Logger.getLogger("lavasoft");
logger.log(Level.SEVERE, "something may be wrong", e);
}
Message msg = new Message();
msg.obj = bitmap;
@ -308,7 +301,7 @@ public class LoginActivity extends Activity implements OnClickListener {
@Override
public void onCancel() {
//do nothing
}
};
mInfo = new UserInfo(this, mTencent.getQQToken());
@ -331,6 +324,8 @@ public class LoginActivity extends Activity implements OnClickListener {
mTencent.setOpenId(openId);
}
} catch (Exception e) {
Logger logger = Logger.getLogger("lavasoft");
logger.log(Level.SEVERE, "something may be wrong", e);
}
}

View File

@ -100,15 +100,7 @@ public class MineInfoActivity extends Activity {
public void clickEdit(View v) {
Intent toEditMineInfo = new Intent(MineInfoActivity.this, MineInfoEditActivity.class);
// Bundle bundle = new Bundle();
// bundle.putString("username", curUser.getUsername());
// bundle.putString("school", curUser.getSchool());
// bundle.putString("cademy", curUser.getCademy());
// bundle.putString("dorpart", curUser.getDorPart());
// bundle.putString("dornum", curUser.getDorNum());
// bundle.putString("phone", curUser.getPhone());
// bundle.putString("qq", curUser.getQQ());
// toEditMineInfo.putExtras(bundle);
startActivity(toEditMineInfo);
}

Binary file not shown.