本文整理汇总了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();
}
}
示例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();
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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);
}
}
示例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);
}