android.content.Intent#getSourceBounds ( )源码实例Demo

下面列出了android.content.Intent#getSourceBounds ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: zhangshangwuda   文件: OneKeyWifi.java
@Override
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	setContentView(R.layout.wifi_onekey);
	final Intent intent = getIntent();
	SharedPreferences localSharedPreferences = OneKeyWifi.this
			.getSharedPreferences("User_Data", 0);
	String str1 = localSharedPreferences.getString("wifi_Account", "");
	String str2 = localSharedPreferences.getString("wifi_Password", "");
	try {
		Account = BosCrypto.decrypt(BosCrypto.Excalibur, str1);
		Password = BosCrypto.decrypt(BosCrypto.Excalibur, str2);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	wifiManager = (WifiManager) OneKeyWifi.this
			.getSystemService(Context.WIFI_SERVICE);
	bg = (FrameLayout) findViewById(R.id.anim_layout);
	Rect rect = intent.getSourceBounds();
	if (rect != null) {
		// int i = getResources().getDimensionPixelSize(0x7f0b001d);
		int i = 5;
		int j = rect.left + rect.width() / 2;
		int k = i + rect.top;
		android.widget.RelativeLayout.LayoutParams layoutparams = (android.widget.RelativeLayout.LayoutParams) bg
				.getLayoutParams();
		layoutparams.leftMargin = j - layoutparams.width / 2;
		layoutparams.topMargin = k - layoutparams.height / 2;
		bg.setLayoutParams(layoutparams);
	}
	final ImageView iv = (ImageView) findViewById(R.id.anim_image);
	iv.setScaleType(ScaleType.CENTER);

	final InputStream is = getResources().openRawResource(
			R.drawable.wifi_onekey_cat);
	final GifFrame[] frames = CommonUtil.getGif(is);
	// System.out.println("delay:" + frames[1].delay + ",size:"
	// + frames.length);
	if (GetWifiStatus())
		new Thread(new OnlineThread()).start();
	else
		CheckNetwork();
	// new Thread(new OnlineThread()).start();
	mGifTask = new PlayGifTask(iv, frames);
	mGifTask.start();
}
 
 方法所在类
 同类方法