com.gizwits.opensource.appkit.CommonModule.GosDeploy Java Examples

The following examples show how to use com.gizwits.opensource.appkit.CommonModule.GosDeploy. 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 Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosDeviceListActivity.java    License: MIT License 6 votes vote down vote up
protected void didUserLogin(GizWifiErrorCode result, java.lang.String uid, java.lang.String token) {

		if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
			loginStatus = 2;
			this.uid = uid;
			this.token = token;
			spf.edit().putString("Uid", this.uid).commit();
			spf.edit().putString("Token", this.token).commit();
			handler.sendEmptyMessage(GETLIST);
			// TODO 绑定推送
			GosPushManager.pushBindService(token);
		} else {
			loginStatus = 0;
			if (GosDeploy.setAnonymousLogin()) {
				tryUserLoginAnonymous();
			}

		}
	}
 
Example #2
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosMainActivity.java    License: MIT License 6 votes vote down vote up
/**
 * 初始化动画
 */
@SuppressWarnings("deprecation")
private void InitImageView() {
	cursor = (ImageView) findViewById(R.id.cursor);
	bmpW = BitmapFactory.decodeResource(getResources(), R.drawable.roller).getWidth();// 获取图片宽度
	DisplayMetrics dm = new DisplayMetrics();
	getWindowManager().getDefaultDisplay().getMetrics(dm);
	int screenW = dm.widthPixels;// 获取分辨率宽度
	offset = (screenW / 3 - bmpW) / 2;// 计算偏移量
	Matrix matrix = new Matrix();
	matrix.postTranslate(offset, 0);
	cursor.setImageMatrix(matrix);// 设置动画初始位置

	LinearLayout myll = (LinearLayout) findViewById(R.id.linearLayout1);
	
	myll.setVisibility(GosDeploy.setUsingTabSetOn());
	
	myll.setBackgroundDrawable(GosDeploy.setNavigationBarColor());
}
 
Example #3
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: RoundProgressBar.java    License: MIT License 6 votes vote down vote up
public RoundProgressBar(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	paint = new Paint();

	TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundProgressBar);

	// 获取自定义属性和默认值
	int color = GosDeploy.setConfigProgressViewColor();
	roundColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundColor, color);
	roundProgressColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundProgressColor, color);
	textColor = mTypedArray.getColor(R.styleable.RoundProgressBar_textColor, Color.BLACK);
	textSize = mTypedArray.getDimension(R.styleable.RoundProgressBar_textSize, 35);
	roundWidth = mTypedArray.getDimension(R.styleable.RoundProgressBar_roundWidth, 3);
	max = mTypedArray.getInteger(R.styleable.RoundProgressBar_max, 100);
	textIsDisplayable = mTypedArray.getBoolean(R.styleable.RoundProgressBar_textIsDisplayable, true);
	style = mTypedArray.getInt(R.styleable.RoundProgressBar_style, 0);

	mTypedArray.recycle();
}
 
Example #4
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: AssetsUtils.java    License: MIT License 6 votes vote down vote up
public static void saveFile(String str) {
		String filePath = null;
		
		
		filePath = GosDeploy.fileOutName;
		try {
			if(filePath!=null){
				File file = new File(filePath);
				if (!file.exists()) {
					File dir = new File(file.getParent());
					dir.mkdirs();
					file.createNewFile();
				}
				FileOutputStream outStream = new FileOutputStream(file);
				outStream.write(str.getBytes());
				outStream.close();
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
}
 
Example #5
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	cbSelect = (CheckBox) findViewById(R.id.cbSelect);
	tvSelect = (TextView) findViewById(R.id.tvSelect);
	btnNext = (Button) findViewById(R.id.btnNext);

	/** 加载Gif */
	GifView gif = (GifView) findViewById(R.id.softreset);
	gif.setMovieResource(R.drawable.resetsoftap);

	/** 加载标志位 */
	flag = getIntent().getStringExtra("flag").toString();

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #6
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #7
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosAirlinkChooseDeviceWorkWiFiActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	tvMode = (TextView) findViewById(R.id.tvMode);
	etSSID = (EditText) findViewById(R.id.etSSID);
	etPsw = (EditText) findViewById(R.id.etPsw);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);
	btnNext = (Button) findViewById(R.id.btnNext);
	llChooseMode = (LinearLayout) findViewById(R.id.llChooseMode);
	imgWiFiList = (ImageView) findViewById(R.id.imgWiFiList);

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());
	// llChooseMode.setVisibility(GosDeploy.setModuleSelectOn());

	llChooseMode.setVisibility(View.GONE);
}
 
Example #8
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosCheckDeviceWorkWiFiActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etSSID = (EditText) findViewById(R.id.etSSID);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnNext = (Button) findViewById(R.id.btnNext);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);
	imgWiFiList = (ImageView) findViewById(R.id.imgWiFiList);

	if (!TextUtils.isEmpty(workSSID)) {
		etSSID.setText(workSSID);
		if (checkworkSSIDUsed(workSSID)) {
			if (!TextUtils.isEmpty(spf.getString("workSSIDPsw", ""))) {
				etPsw.setText(spf.getString("workSSIDPsw", ""));
			}
		}
	}

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #9
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosAirlinkReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #10
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosDeviceReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	tvNoRedLight.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());;
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #11
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosRegisterUserActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etName = (EditText) findViewById(R.id.etName);
	btnGetCode = (Button) findViewById(R.id.btnGetCode);
	etCode = (EditText) findViewById(R.id.etCode);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnRrgister = (Button) findViewById(R.id.btnRrgister);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);

	// 配置文件部署
	drawable = (GradientDrawable) GosDeploy.setButtonBackgroundColor();
	drawable.setCornerRadius(30);
	btnGetCode.setBackgroundDrawable(drawable);
	btnRrgister.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnRrgister.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #12
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosForgetPasswordActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etName = (EditText) findViewById(R.id.etName);
	btnGetCode = (Button) findViewById(R.id.btnGetCode);
	etCode = (EditText) findViewById(R.id.etCode);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnReset = (Button) findViewById(R.id.btnReset);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);

	// 配置文件部署
	drawable = (GradientDrawable) GosDeploy.setButtonBackgroundColor();
	drawable.setCornerRadius(30);
	btnGetCode.setBackgroundDrawable(drawable);
	btnReset.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnReset.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #13
Source Project: GOpenSource_AppKit_Android_AS   Author: gizwits   File: GosUserLoginActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etName = (EditText) findViewById(R.id.etName);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnLogin = (Button) findViewById(R.id.btnLogin);
	tvRegister = (TextView) findViewById(R.id.tvRegister);
	tvForget = (TextView) findViewById(R.id.tvForget);
	tvPass = (TextView) findViewById(R.id.tvPass);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);

	DotView DotView = (DotView) findViewById(R.id.dotView1);
	llQQ = (LinearLayout) findViewById(R.id.llQQ);
	llWechat = (LinearLayout) findViewById(R.id.llWechat);
	String setTencentAppID = GosDeploy.setTencentAppID();
	String setWechatAppID = GosDeploy.setWechatAppID();
	// 判断腾讯和微信是否需要隐藏和显示
	setWechatOrTencentIsVisable(DotView);
	// 配置文件部署
	btnLogin.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnLogin.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #14
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: RoundProgressBar.java    License: MIT License 6 votes vote down vote up
public RoundProgressBar(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	paint = new Paint();

	TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundProgressBar);

	// 获取自定义属性和默认值
	int color = GosDeploy.setConfigProgressViewColor();
	roundColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundColor, color);
	roundProgressColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundProgressColor, color);
	textColor = mTypedArray.getColor(R.styleable.RoundProgressBar_textColor, Color.BLACK);
	textSize = mTypedArray.getDimension(R.styleable.RoundProgressBar_textSize, 35);
	roundWidth = mTypedArray.getDimension(R.styleable.RoundProgressBar_roundWidth, 3);
	max = mTypedArray.getInteger(R.styleable.RoundProgressBar_max, 100);
	textIsDisplayable = mTypedArray.getBoolean(R.styleable.RoundProgressBar_textIsDisplayable, true);
	style = mTypedArray.getInt(R.styleable.RoundProgressBar_style, 0);

	mTypedArray.recycle();
}
 
Example #15
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	cbSelect = (CheckBox) findViewById(R.id.cbSelect);
	tvSelect = (TextView) findViewById(R.id.tvSelect);
	btnNext = (Button) findViewById(R.id.btnNext);

	/** 加载Gif */
	GifView gif = (GifView) findViewById(R.id.softreset);
	gif.setMovieResource(R.drawable.resetsoftap);

	/** 加载标志位 */
	flag = getIntent().getStringExtra("flag").toString();

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #16
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.button_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.button_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #17
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosCheckDeviceWorkWiFiActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etSSID = (EditText) findViewById(R.id.etSSID);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnNext = (Button) findViewById(R.id.btnNext);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);
	imgWiFiList = (ImageView) findViewById(R.id.imgWiFiList);

	if (!TextUtils.isEmpty(workSSID)) {
		etSSID.setText(workSSID);
		if (checkworkSSIDUsed(workSSID)) {
			if (!TextUtils.isEmpty(spf.getString("workSSIDPsw", ""))) {
				etPsw.setText(spf.getString("workSSIDPsw", ""));
			}
		}
	}

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #18
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosAirlinkReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.button_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.button_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #19
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosDeviceReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	tvNoRedLight.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.button_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());;
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.button_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #20
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosApplication.java    License: MIT License 6 votes vote down vote up
public void onCreate() {
	super.onCreate();

	// 读取配置文件
	gosDeploy = new GosDeploy(this);
	String AppID = GosDeploy.setAppID();
	String AppSecret = GosDeploy.setAppSecret();

	if (TextUtils.isEmpty(AppID) || AppID.contains("your_app_id") || TextUtils.isEmpty(AppSecret)
			|| AppSecret.contains("your_app_secret")) {
		if (flag == 0) {
		
		}
		flag++;
	} else {

		// 启动SDK
		GizWifiSDK.sharedInstance().startWithAppID(getApplicationContext(), AppID, null, null);

		// 设置日志等级和云端服务
		handler.sendEmptyMessageDelayed(0, 3000);

	}
}
 
Example #21
Source Project: Gizwits-SmartBuld_Android   Author: gizwits   File: GosUserLoginActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etName = (EditText) findViewById(R.id.etName);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnLogin = (Button) findViewById(R.id.btnLogin);
	tvRegister = (TextView) findViewById(R.id.tvRegister);
	tvForget = (TextView) findViewById(R.id.tvForget);
	tvPass = (TextView) findViewById(R.id.tvPass);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);

	llQQ = (LinearLayout) findViewById(R.id.llQQ);
	llWechat = (LinearLayout) findViewById(R.id.llWechat);

	// 配置文件部署
	btnLogin.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnLogin.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #22
Source Project: gokit-android   Author: gizwits   File: GosDeviceListActivity.java    License: MIT License 6 votes vote down vote up
protected void didUserLogin(GizWifiErrorCode result, java.lang.String uid, java.lang.String token) {

		if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
			loginStatus = 2;
			this.uid = uid;
			this.token = token;
			spf.edit().putString("Uid", this.uid).commit();
			spf.edit().putString("Token", this.token).commit();
			handler.sendEmptyMessage(GETLIST);
			// TODO 绑定推送
			GosPushManager.pushBindService(token);
		} else {
			loginStatus = 0;
			if(GosDeploy.setAnonymousLogin()){
				tryUserLoginAnonymous();
			}
			
		}
	}
 
Example #23
Source Project: gokit-android   Author: gizwits   File: RoundProgressBar.java    License: MIT License 6 votes vote down vote up
public RoundProgressBar(Context context, AttributeSet attrs, int defStyle) {
	super(context, attrs, defStyle);

	paint = new Paint();

	TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundProgressBar);

	// 获取自定义属性和默认值
	int color = GosDeploy.setConfigProgressViewColor();
	roundColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundColor, color);
	roundProgressColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundProgressColor, color);
	textColor = mTypedArray.getColor(R.styleable.RoundProgressBar_textColor, Color.BLACK);
	textSize = mTypedArray.getDimension(R.styleable.RoundProgressBar_textSize, 35);
	roundWidth = mTypedArray.getDimension(R.styleable.RoundProgressBar_roundWidth, 3);
	max = mTypedArray.getInteger(R.styleable.RoundProgressBar_max, 100);
	textIsDisplayable = mTypedArray.getBoolean(R.styleable.RoundProgressBar_textIsDisplayable, true);
	style = mTypedArray.getInt(R.styleable.RoundProgressBar_style, 0);

	mTypedArray.recycle();
}
 
Example #24
Source Project: gokit-android   Author: gizwits   File: AssetsUtils.java    License: MIT License 6 votes vote down vote up
public static void saveFile(String str) {
		String filePath = null;
		
		
		filePath = GosDeploy.fileOutName;
		try {
			if(filePath!=null){
				File file = new File(filePath);
				if (!file.exists()) {
					File dir = new File(file.getParent());
					dir.mkdirs();
					file.createNewFile();
				}
				FileOutputStream outStream = new FileOutputStream(file);
				outStream.write(str.getBytes());
				outStream.close();
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
}
 
Example #25
Source Project: gokit-android   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	cbSelect = (CheckBox) findViewById(R.id.cbSelect);
	tvSelect = (TextView) findViewById(R.id.tvSelect);
	btnNext = (Button) findViewById(R.id.btnNext);

	/** 加载Gif */
	GifView gif = (GifView) findViewById(R.id.softreset);
	gif.setMovieResource(R.drawable.resetsoftap);

	/** 加载标志位 */
	flag = getIntent().getStringExtra("flag").toString();

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #26
Source Project: gokit-android   Author: gizwits   File: GosDeviceResetActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #27
Source Project: gokit-android   Author: gizwits   File: GosCheckDeviceWorkWiFiActivity.java    License: MIT License 6 votes vote down vote up
private void initView() {
	etSSID = (EditText) findViewById(R.id.etSSID);
	etPsw = (EditText) findViewById(R.id.etPsw);
	btnNext = (Button) findViewById(R.id.btnNext);
	cbLaws = (CheckBox) findViewById(R.id.cbLaws);
	imgWiFiList = (ImageView) findViewById(R.id.imgWiFiList);

	if (!TextUtils.isEmpty(workSSID)) {
		etSSID.setText(workSSID);
		if (checkworkSSIDUsed(workSSID)) {
			if (!TextUtils.isEmpty(spf.getString("workSSIDPsw", ""))) {
				etPsw.setText(spf.getString("workSSIDPsw", ""));
			}
		}
	}

	// 配置文件部署
	btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
	btnNext.setTextColor(GosDeploy.setButtonTextColor());

}
 
Example #28
Source Project: gokit-android   Author: gizwits   File: GosAirlinkReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	btnNext.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #29
Source Project: gokit-android   Author: gizwits   File: GosDeviceReadyActivity.java    License: MIT License 6 votes vote down vote up
private void initEvent() {
	tvNoRedLight.setOnClickListener(this);
	tvSelect.setOnClickListener(this);
	btnNext.setOnClickListener(this);
	btnNext.setClickable(false);
	btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);

	cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
			if (isChecked) {
				btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());;
				btnNext.setClickable(true);
			} else {
				btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
				btnNext.setClickable(false);
			}

		}
	});
}
 
Example #30
Source Project: gokit-android   Author: gizwits   File: MessageCenter.java    License: MIT License 6 votes vote down vote up
private void init(Context c) {
	gosDeploy = new GosDeploy(c);
	String AppID = GosDeploy.setAppID();
	String AppSecret = GosDeploy.setAppSecret();
	if (TextUtils.isEmpty(AppID) || AppID.contains("your_app_id") || TextUtils.isEmpty(AppSecret)
			|| AppSecret.contains("your_app_secret")) {
		String AppID_Toast = c.getString(R.string.AppID_Toast);
		if (flag == 0) {
			Toast.makeText(c, AppID_Toast, Toast.LENGTH_LONG).show();
		}
		flag++;
	} else {
		// 启动SDK
		ConcurrentHashMap<String, String> serverMap = new ConcurrentHashMap<String, String>();

		serverMap.put("openAPIInfo", TextUtils.isEmpty((String) GosDeploy.infoMap.get("openAPIDomain"))
				? "api.gizwits.com" : (String) GosDeploy.infoMap.get("openAPIDomain"));
		serverMap.put("siteInfo", TextUtils.isEmpty((String) GosDeploy.infoMap.get("siteDomain"))
				? "site.gizwits.com" : (String) GosDeploy.infoMap.get("siteDomain"));
		serverMap.put("pushInfo", (String) GosDeploy.infoMap.get("pushDomain"));
		GizWifiSDK.sharedInstance().startWithAppID(c, AppID, GosDeploy.setProductKeyList(), serverMap, false);
	}
	hand.sendEmptyMessageDelayed(SETCLOUD, 3000);

}