当前位置: 首页>>代码示例>>Java>>正文


Java UIHandler类代码示例

本文整理汇总了Java中cn.sharesdk.framework.utils.UIHandler的典型用法代码示例。如果您正苦于以下问题:Java UIHandler类的具体用法?Java UIHandler怎么用?Java UIHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UIHandler类属于cn.sharesdk.framework.utils包,在下文中一共展示了UIHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showNotification

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void showNotification(long cancelTime, String text) {
	try {
		Context app = getContext().getApplicationContext();
		NotificationManager nm = (NotificationManager) app
				.getSystemService(Context.NOTIFICATION_SERVICE);
		final int id = Integer.MAX_VALUE / 13 + 1;
		nm.cancel(id);

		long when = System.currentTimeMillis();
		Notification notification = new Notification(notifyIcon, text, when);
		PendingIntent pi = PendingIntent.getActivity(app, 0, new Intent(), 0);
		notification.setLatestEventInfo(app, notifyTitle, text, pi);
		notification.flags = Notification.FLAG_AUTO_CANCEL;
		nm.notify(id, notification);

		if (cancelTime > 0) {
			Message msg = new Message();
			msg.what = MSG_CANCEL_NOTIFY;
			msg.obj = nm;
			msg.arg1 = id;
			UIHandler.sendMessageDelayed(msg, cancelTime, this);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:27,代码来源:OnekeyShare.java

示例2: init

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
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);

	// 为了更好的ui效果,开启子线程获取平台列表
	new Thread() {
		public void run() {
			platformList = ShareSDK.getPlatformList();
			if (platformList == null) {
				platformList = new Platform[0];
			}
			UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
		}
	}.start();
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:21,代码来源:PlatformGridView.java

示例3: showNotification

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void showNotification(long cancelTime, String text) {
	try {
		Context app = context.getApplicationContext();
		NotificationManager nm = (NotificationManager) app
				.getSystemService(Context.NOTIFICATION_SERVICE);
		final int id = Integer.MAX_VALUE / 13 + 1;
		nm.cancel(id);

		long when = System.currentTimeMillis();
		Notification notification = new Notification(notifyIcon, text, when);
		PendingIntent pi = PendingIntent.getActivity(app, 0, new Intent(), 0);
		notification.setLatestEventInfo(app, notifyTitle, text, pi);
		notification.flags = Notification.FLAG_AUTO_CANCEL;
		nm.notify(id, notification);

		if (cancelTime > 0) {
			Message msg = new Message();
			msg.what = MSG_CANCEL_NOTIFY;
			msg.obj = nm;
			msg.arg1 = id;
			UIHandler.sendMessageDelayed(msg, cancelTime, this);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:nickalc,项目名称:csdn-master,代码行数:27,代码来源:OnekeyShare.java

示例4: onComplete

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
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);
	}
}
 
开发者ID:nickalc,项目名称:csdn-master,代码行数:17,代码来源:FollowListPage.java

示例5: init

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
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() {
			platformList = ShareSDK.getPlatformList();
			if (platformList == null) {
				platformList = new Platform[0];
			}
			UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
		}
	}.start();
}
 
开发者ID:nickalc,项目名称:csdn-master,代码行数:21,代码来源:PlatformGridView.java

示例6: authorize

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void authorize(Platform plat) {
	if (plat == null) {
		popupOthers();
		return;
	}
	
	this.plat = plat;
	
	if(plat.isValid()) {
		String userId = plat.getDb().getUserId();
		String userName = plat.getDb().getUserName();
		if (userId != null) {
			UIHandler.sendEmptyMessage(MSG_USERID_FOUND, this);
			login(userName, userId, null);
			return;
		}
	}
	plat.setPlatformActionListener(this);
	plat.SSOSetting(true);
	plat.showUser(null);
}
 
开发者ID:chiemy,项目名称:ShareSdkThridPartyLoginDemo,代码行数:22,代码来源:LoginActivity.java

示例7: init

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void init(final Context context) {
	calPageSize();
	setOrientation(VERTICAL);

	pager = new ViewPager(context);
	disableOverScrollMode(pager);
	pager.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
	pager.setOnPageChangeListener(this);
	addView(pager);

	// 为了更好的ui效果,开启子线程获取平台列表
	new Thread(){
		public void run() {
			platformList = ShareSDK.getPlatformList(context);
			UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
		}
	}.start();
}
 
开发者ID:chiemy,项目名称:ShareSdkThridPartyLoginDemo,代码行数:19,代码来源:PlatformGridView.java

示例8: showNotification

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void showNotification(long cancelTime, String text) {
    try {
        Context app = getContext().getApplicationContext();
        NotificationManager nm = (NotificationManager) app.getSystemService(Context.NOTIFICATION_SERVICE);
        final int id = Integer.MAX_VALUE / 13 + 1;
        nm.cancel(id);

        long when = System.currentTimeMillis();
        Notification notification = new Notification(notifyIcon, text, when);
        PendingIntent pi = PendingIntent.getActivity(app, 0, new Intent(), 0);
        notification.setLatestEventInfo(app, notifyTitle, text, pi);
        notification.flags = Notification.FLAG_AUTO_CANCEL;
        nm.notify(id, notification);

        if (cancelTime > 0) {
            Message msg = new Message();
            msg.what = MSG_CANCEL_NOTIFY;
            msg.obj = nm;
            msg.arg1 = id;
            UIHandler.sendMessageDelayed(msg, cancelTime, this);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:csuyzb,项目名称:AndroidLinkup,代码行数:26,代码来源:OnekeyShare.java

示例9: onCreate

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	orientation = getResources().getConfiguration().orientation;

	menu = new SlidingMenu(this);
	menu.setMenuItemBackground(R.color.sliding_menu_item_down, R.color.sliding_menu_item_release);
	menu.setMenuBackground(R.color.sliding_menu_background);
	menu.setTtleHeight(cn.sharesdk.framework.utils.R.dipToPx(this, 44));
	menu.setBodyBackground(R.color.sliding_menu_body_background);
	menu.setShadowRes(R.drawable.sliding_menu_right_shadow);
	menu.setMenuDivider(R.drawable.sliding_menu_sep);
	menu.setAdapter(new MainAdapter(menu));
	setContentView(menu);

	ShareSDK.initSDK(this);

	new Thread() {
		public void run() {
			initImagePath();
			UIHandler.sendEmptyMessageDelayed(1, 100, MainActivity.this);
		}
	}.start();
}
 
开发者ID:snowdream,项目名称:android-sharesdk,代码行数:24,代码来源:MainActivity.java

示例10: init

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
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() {
			platformList = ShareSDK.getPlatformList(context);
			if (platformList == null) {
				platformList = new Platform[0];
			}
			UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
		}
	}.start();
}
 
开发者ID:snowdream,项目名称:android-sharesdk,代码行数:21,代码来源:PlatformGridView.java

示例11: showNotification

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void showNotification(long cancelTime, String text) {
	try {
		Context app = getApplicationContext();
		NotificationManager nm = (NotificationManager) app
				.getSystemService(Context.NOTIFICATION_SERVICE);
		final int id = Integer.MAX_VALUE / 13 + 1;
		nm.cancel(id);

		long when = System.currentTimeMillis();
		Notification notification = new Notification(R.drawable.ic_launcher, text, when);
		PendingIntent pi = PendingIntent.getActivity(app, 0, new Intent(), 0);
		notification.setLatestEventInfo(app, "sharesdk test", text, pi);
		notification.flags = Notification.FLAG_AUTO_CANCEL;
		nm.notify(id, notification);

		if (cancelTime > 0) {
			Message msg = new Message();
			msg.what = MSG_CANCEL_NOTIFY;
			msg.obj = nm;
			msg.arg1 = id;
			UIHandler.sendMessageDelayed(msg, cancelTime, this);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:MobClub,项目名称:Android_ShareSDK_Example_OnekeyShare,代码行数:27,代码来源:MainActivity.java

示例12: showNotification

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void showNotification(long cancelTime, String text) {
	try {
		Context app = getContext().getApplicationContext();
		NotificationManager nm = (NotificationManager) app
				.getSystemService(Context.NOTIFICATION_SERVICE);
		final int id = Integer.MAX_VALUE / 13 + 1;
		nm.cancel(id);
		
		long when = System.currentTimeMillis();
		Notification notification = new Notification(notifyIcon, text, when);
		PendingIntent pi = PendingIntent.getActivity(app, 0, new Intent(), 0);
		notification.setLatestEventInfo(app, notifyTitle, text, pi);
		notification.flags = Notification.FLAG_AUTO_CANCEL;
		nm.notify(id, notification);
		
		if (cancelTime > 0) {
			Message msg = new Message();
			msg.what = MSG_CANCEL_NOTIFY;
			msg.obj = nm;
			msg.arg1 = id;
			UIHandler.sendMessageDelayed(msg, cancelTime, this);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:MobClub,项目名称:android_demo_cocos2d-x_plugin-x,代码行数:27,代码来源:OnekeyShare.java

示例13: init

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
private void init(final Context context) {
	calPageSize();
	setOrientation(VERTICAL);
	
	pager = new ViewPager(context);
	disableOverScrollMode(pager);
	pager.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
	pager.setOnPageChangeListener(this);
	addView(pager);
	
	//#if def{lang} == cn
	// 为了更好的ui效果,开启子线程获取平台列表
	//#endif
	new Thread(){
		public void run() {
			platformList = ShareSDK.getPlatformList(context);
			UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this);
		}
	}.start();
}
 
开发者ID:MobClub,项目名称:android_demo_cocos2d-x_plugin-x,代码行数:21,代码来源:PlatformGridView.java

示例14: onComplete

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
public void onComplete(Platform plat, int action, HashMap<String, Object> res) {
	ArrayList<Following> data = parseList(res);
	if (data != null && data.size() > 0) {
		curPage++;
		Message msg = new Message();
		msg.what = 1;
		msg.obj = data;
		UIHandler.sendMessage(msg, this);
	}
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:11,代码来源:FollowList.java

示例15: onComplete

import cn.sharesdk.framework.utils.UIHandler; //导入依赖的package包/类
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);
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:10,代码来源:OnekeyShare.java


注:本文中的cn.sharesdk.framework.utils.UIHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。