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 File: GosAirlinkReadyActivity.java    From gokit-android with 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 #2
Source File: GosMainActivity.java    From GOpenSource_AppKit_Android_AS with 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 File: MessageCenter.java    From gokit-android with 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);

}
 
Example #4
Source File: GosCheckDeviceWorkWiFiActivity.java    From GOpenSource_AppKit_Android_AS with 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 #5
Source File: GosUserLoginActivity.java    From gokit-android with 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 = (com.gizwits.opensource.appkit.view.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 #6
Source File: RoundProgressBar.java    From GOpenSource_AppKit_Android_AS with 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 #7
Source File: GosAirlinkChooseDeviceWorkWiFiActivity.java    From GOpenSource_AppKit_Android_AS with 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 File: GosUserLoginActivity.java    From gokit-android with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setTheme(R.style.AppTheme);
	if (!this.isTaskRoot()) {// 判断此activity是不是任务控件的源Activity,“非”也就是说是被系统重新实例化出来的
		Intent mainIntent = getIntent();
		String action = mainIntent.getAction();
		if (mainIntent.hasCategory(Intent.CATEGORY_LAUNCHER) && action.equals(Intent.ACTION_MAIN)) {
			finish();
			return;
		}
	}
	if (GosApplication.flag != 0) {
		GosBaseActivity.noIDAlert(this, R.string.AppID_Toast);
	}

	// 在配置文件中选择推送类型(0:不开启推送,1:极光推送,2:百度推送。默认为0)
	gosPushManager = new GosPushManager(GosDeploy.setPushType(), this);

	setContentView(R.layout.activity_gos_user_login);
	// 设置actionBar
	setActionBar(false, false, R.string.app_company);
	initView();
	initEvent();
}
 
Example #9
Source File: GosDeviceResetActivity.java    From GOpenSource_AppKit_Android_AS with 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 File: GosDeviceResetActivity.java    From GOpenSource_AppKit_Android_AS with 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 #11
Source File: AssetsUtils.java    From GOpenSource_AppKit_Android_AS with 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 #12
Source File: GosForgetPasswordActivity.java    From gokit-android with 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 File: GosRegisterUserActivity.java    From GOpenSource_AppKit_Android_AS with 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 #14
Source File: GosForgetPasswordActivity.java    From GOpenSource_AppKit_Android_AS with 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 #15
Source File: GosUserLoginActivity.java    From GOpenSource_AppKit_Android_AS with 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 #16
Source File: GosDeviceReadyActivity.java    From gokit-android with 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 #17
Source File: GosCheckDeviceWorkWiFiActivity.java    From gokit-android with 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 File: RoundProgressBar.java    From Gizwits-SmartBuld_Android with 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 #19
Source File: GosDeviceResetActivity.java    From Gizwits-SmartBuld_Android with 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 #20
Source File: GosDeviceResetActivity.java    From Gizwits-SmartBuld_Android with 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 #21
Source File: GosCheckDeviceWorkWiFiActivity.java    From Gizwits-SmartBuld_Android with 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 #22
Source File: GosDeviceResetActivity.java    From gokit-android with 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 #23
Source File: GosAirlinkReadyActivity.java    From Gizwits-SmartBuld_Android with 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 #24
Source File: GosDeviceResetActivity.java    From gokit-android with 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 #25
Source File: GosDeviceReadyActivity.java    From Gizwits-SmartBuld_Android with 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 #26
Source File: AssetsUtils.java    From gokit-android with 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 #27
Source File: RoundProgressBar.java    From gokit-android with 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 #28
Source File: GosDeviceListActivity.java    From gokit-android with 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 #29
Source File: GosApplication.java    From Gizwits-SmartBuld_Android with 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 #30
Source File: GosUserLoginActivity.java    From Gizwits-SmartBuld_Android with 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());

}