Java Code Examples for com.gizwits.opensource.appkit.DeviceModule.GosDeviceListActivity#loginStatus()

The following examples show how to use com.gizwits.opensource.appkit.DeviceModule.GosDeviceListActivity#loginStatus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GosUserManager.java    From GOpenSource_AppKit_Android_AS with MIT License 6 votes vote down vote up
private void logoutToClean() {
	GosPushManager.pushUnBindService(spf.getString("Token", ""));
	spf.edit().putString("UserName", "").commit();
	isclean = true;
	spf.edit().putString("PassWord", "").commit();
	spf.edit().putString("Uid", "").commit();
	spf.edit().putString("Token", "").commit();

	spf.edit().putString("thirdUid", "").commit();

	if (GosDeviceListActivity.loginStatus == 1) {
		GosDeviceListActivity.loginStatus = 0;
	} else {
		GosDeviceListActivity.loginStatus = 4;
	}

}
 
Example 2
Source File: GosUserLoginActivity.java    From GOpenSource_AppKit_Android_AS with MIT License 6 votes vote down vote up
/** 注销函数 */
void logoutToClean() {
	spf.edit().putString("UserName", "").commit();
	spf.edit().putString("PassWord", "").commit();
	spf.edit().putString("Uid", "").commit();
	spf.edit().putString("thirdUid", "").commit();

	spf.edit().putString("Token", "").commit();

	if (GosDeviceListActivity.loginStatus == 1) {
		GosDeviceListActivity.loginStatus = 0;
	} else {
		GosDeviceListActivity.loginStatus = 4;
	}

}
 
Example 3
Source File: GosUserLoginActivity.java    From GOpenSource_AppKit_Android_AS with MIT License 5 votes vote down vote up
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), toastTime).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, toastTime).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())
				&& TextUtils.isEmpty(spf.getString("thirdUid", ""))) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosMainActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);

	}
}
 
Example 4
Source File: GosUserLoginActivity.java    From Gizwits-SmartBuld_Android with MIT License 5 votes vote down vote up
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), 2000).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, 2000).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosDeviceListActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);
	}
}
 
Example 5
Source File: GosUserLoginActivity.java    From gokit-android with MIT License 5 votes vote down vote up
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), toastTime).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, toastTime).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosDeviceListActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);

	}
}