com.mob.tools.utils.UIHandler Java Examples

The following examples show how to use com.mob.tools.utils.UIHandler. 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: PlatformGridView.java    From BigApp_Discuz_Android with Apache License 2.0 6 votes vote down vote up
private void init(final Context context) {
	calPageSize();
	setOrientation(VERTICAL);

	pager = new ViewPagerClassic(context);
	disableOverScrollMode(pager);
	pager.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	addView(pager);

	// in order to have a better UI effect, opening a thread request the list of platforms
	new Thread() {
		public void run() {
			try {
				platformList = ShareSDK.getPlatformList();
				if (platformList == null) {
					platformList = new Platform[0];
				}
				UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
			} catch (Throwable t) {
				t.printStackTrace();
			}
		}
	}.start();
}
 
Example #2
Source File: FollowListPage.java    From BigApp_Discuz_Android with Apache License 2.0 6 votes vote down vote up
public void onComplete(Platform plat, int action, HashMap<String, Object> res) {
	FollowersResult followersResult = parseFollowers(platform.getName(), res, map);

	if(followersResult == null) {
		UIHandler.sendEmptyMessage(FOLLOW_LIST_EMPTY, this);
		return;
	}
	hasNext = followersResult.hasNextPage;
	if (followersResult.list != null && followersResult.list.size() > 0) {
		curPage++;
		Message msg = new Message();
		msg.what = 1;
		msg.obj = followersResult.list;
		UIHandler.sendMessage(msg, this);
	}
}
 
Example #3
Source File: FollowListPage.java    From BigApp_Discuz_Android with Apache License 2.0 6 votes vote down vote up
public void onComplete(Platform plat, int action, HashMap<String, Object> res) {
	FollowersResult followersResult = parseFollowers(platform.getName(), res, map);

	if(followersResult == null) {
		UIHandler.sendEmptyMessage(FOLLOW_LIST_EMPTY, this);
		return;
	}
	hasNext = followersResult.hasNextPage;
	if (followersResult.list != null && followersResult.list.size() > 0) {
		curPage++;
		Message msg = new Message();
		msg.what = 1;
		msg.obj = followersResult.list;
		UIHandler.sendMessage(msg, this);
	}
}
 
Example #4
Source File: PlatformGridView.java    From BigApp_WordPress_Android with Apache License 2.0 6 votes vote down vote up
private void init(final Context context) {
	calPageSize();
	setOrientation(VERTICAL);

	pager = new ViewPagerClassic(context);
	disableOverScrollMode(pager);
	pager.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	addView(pager);

	// in order to have a better UI effect, opening a thread request the list of platforms
	new Thread() {
		public void run() {
			try {
				platformList = ShareSDK.getPlatformList();
				if (platformList == null) {
					platformList = new Platform[0];
				}
				UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
			} catch (Throwable t) {
				t.printStackTrace();
			}
		}
	}.start();
}
 
Example #5
Source File: FollowListPage.java    From BigApp_WordPress_Android with Apache License 2.0 6 votes vote down vote up
public void onComplete(Platform plat, int action, HashMap<String, Object> res) {
	FollowersResult followersResult = parseFollowers(platform.getName(), res, map);

	if(followersResult == null) {
		UIHandler.sendEmptyMessage(FOLLOW_LIST_EMPTY, this);
		return;
	}
	hasNext = followersResult.hasNextPage;
	if (followersResult.list != null && followersResult.list.size() > 0) {
		curPage++;
		Message msg = new Message();
		msg.what = 1;
		msg.obj = followersResult.list;
		UIHandler.sendMessage(msg, this);
	}
}
 
Example #6
Source File: FollowListPage.java    From BigApp_WordPress_Android with Apache License 2.0 6 votes vote down vote up
public void onComplete(Platform plat, int action, HashMap<String, Object> res) {
	FollowersResult followersResult = parseFollowers(platform.getName(), res, map);

	if(followersResult == null) {
		UIHandler.sendEmptyMessage(FOLLOW_LIST_EMPTY, this);
		return;
	}
	hasNext = followersResult.hasNextPage;
	if (followersResult.list != null && followersResult.list.size() > 0) {
		curPage++;
		Message msg = new Message();
		msg.what = 1;
		msg.obj = followersResult.list;
		UIHandler.sendMessage(msg, this);
	}
}
 
Example #7
Source File: OnekeyShareThemeImpl.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
public final void onError(Platform platform, int action, Throwable t) {
	t.printStackTrace();

	Message msg = new Message();
	msg.arg1 = 2;
	msg.arg2 = action;
	msg.obj = t;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(4, platform);
}
 
Example #8
Source File: ReflectableShareContentCustomizeCallback.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
@Override
public void onShare(Platform platform, ShareParams paramsToShare) {
	if (onShareCallback != null) {
		Message msg = new Message();
		msg.what = onShareWhat;
		msg.obj = new Object[] {platform, paramsToShare};
		UIHandler.sendMessage(msg, onShareCallback);
	}
}
 
Example #9
Source File: OnekeyShare.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
public void onCancel(Platform platform, int action) {
	Message msg = new Message();
	msg.what = MSG_ACTION_CCALLBACK;
	msg.arg1 = 3;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(5, platform);
}
 
Example #10
Source File: FriendAdapter.java    From HHComicViewer with Apache License 2.0 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}
 
Example #11
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
public final void onCancel(Platform platform, int action) {
	Message msg = new Message();
	msg.arg1 = 3;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(5, platform);
}
 
Example #12
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
public final void onError(Platform platform, int action, Throwable t) {
	t.printStackTrace();

	Message msg = new Message();
	msg.arg1 = 2;
	msg.arg2 = action;
	msg.obj = t;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(4, platform);
}
 
Example #13
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
public final void onComplete(Platform platform, int action,
		HashMap<String, Object> res) {
	Message msg = new Message();
	msg.arg1 = 1;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);
}
 
Example #14
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
private void toast(final String resOrName) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			int resId = R.getStringRes(context, resOrName);
			if (resId > 0) {
				Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
			} else {
				Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
			}
			return false;
		}
	});
}
 
Example #15
Source File: FriendAdapter.java    From fingerpoetry-android with Apache License 2.0 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}
 
Example #16
Source File: ReflectableShareContentCustomizeCallback.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
@Override
public void onShare(Platform platform, ShareParams paramsToShare) {
	if (onShareCallback != null) {
		Message msg = new Message();
		msg.what = onShareWhat;
		msg.obj = new Object[] {platform, paramsToShare};
		UIHandler.sendMessage(msg, onShareCallback);
	}
}
 
Example #17
Source File: OnekeyShareThemeImpl.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
private void toast(final String resOrName) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			int resId = R.getStringRes(context, resOrName);
			if (resId > 0) {
				Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
			} else {
				Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
			}
			return false;
		}
	});
}
 
Example #18
Source File: OnekeyShareThemeImpl.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
public final void onComplete(Platform platform, int action,
		HashMap<String, Object> res) {
	Message msg = new Message();
	msg.arg1 = 1;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);
}
 
Example #19
Source File: OnekeyShareThemeImpl.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
public final void onComplete(Platform platform, int action,
		HashMap<String, Object> res) {
	Message msg = new Message();
	msg.arg1 = 1;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);
}
 
Example #20
Source File: OnekeyShareThemeImpl.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
private void toast(final String resOrName) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			int resId = R.getStringRes(context, resOrName);
			if (resId > 0) {
				Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
			} else {
				Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
			}
			return false;
		}
	});
}
 
Example #21
Source File: FriendAdapter.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}
 
Example #22
Source File: FriendAdapter.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}
 
Example #23
Source File: OnekeyShareThemeImpl.java    From HHComicViewer with Apache License 2.0 5 votes vote down vote up
public final void onError(Platform platform, int action, Throwable t) {
	t.printStackTrace();

	Message msg = new Message();
	msg.arg1 = 2;
	msg.arg2 = action;
	msg.obj = t;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(4, platform);
}
 
Example #24
Source File: OnekeyShare.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public void onError(Platform platform, int action, Throwable t) {
	t.printStackTrace();

	Message msg = new Message();
	msg.what = MSG_ACTION_CCALLBACK;
	msg.arg1 = 2;
	msg.arg2 = action;
	msg.obj = t;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(4, platform);
}
 
Example #25
Source File: OnekeyShare.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public void onComplete(Platform platform, int action,
		HashMap<String, Object> res) {
	Message msg = new Message();
	msg.what = MSG_ACTION_CCALLBACK;
	msg.arg1 = 1;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);
}
 
Example #26
Source File: OnekeyShareThemeImpl.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
public final void onCancel(Platform platform, int action) {
	Message msg = new Message();
	msg.arg1 = 3;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);

	// 分享失败的统计
	ShareSDK.logDemoEvent(5, platform);
}
 
Example #27
Source File: FriendAdapter.java    From POCenter with MIT License 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}
 
Example #28
Source File: OnekeyShareThemeImpl.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
public final void onComplete(Platform platform, int action,
		HashMap<String, Object> res) {
	Message msg = new Message();
	msg.arg1 = 1;
	msg.arg2 = action;
	msg.obj = platform;
	UIHandler.sendMessage(msg, this);
}
 
Example #29
Source File: OnekeyShareThemeImpl.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
private void toast(final String resOrName) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			int resId = ResHelper.getStringRes(context, resOrName);
			if (resId > 0) {
				Toast.makeText(context, resId, Toast.LENGTH_SHORT).show();
			} else {
				Toast.makeText(context, resOrName, Toast.LENGTH_SHORT).show();
			}
			return false;
		}
	});
}
 
Example #30
Source File: FriendAdapter.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
public void onCancel(Platform plat, int action) {
	UIHandler.sendEmptyMessage(0, new Callback() {
		public boolean handleMessage(Message msg) {
			activity.finish();
			return false;
		}
	});
}