本文整理汇总了Java中cn.sharesdk.onekeyshare.ShareCore.isDirectShare方法的典型用法代码示例。如果您正苦于以下问题:Java ShareCore.isDirectShare方法的具体用法?Java ShareCore.isDirectShare怎么用?Java ShareCore.isDirectShare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.sharesdk.onekeyshare.ShareCore
的用法示例。
在下文中一共展示了ShareCore.isDirectShare方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import cn.sharesdk.onekeyshare.ShareCore; //导入方法依赖的package包/类
public void onClick(View view) {
Integer position = ((ViewHolder) view.getTag()).position;
if (this.directOnlyPosition == -1 || position.intValue() == this.directOnlyPosition) {
boolean direct;
Object item = getItem(position.intValue());
if (item instanceof Platform) {
direct = ShareCore.isDirectShare((Platform) item);
} else {
direct = true;
}
if (!direct || this.directOnlyPosition != -1 || this.checkedPositionList.isEmpty()) {
if (this.checkedPositionList.contains(position)) {
this.checkedPositionList.remove(position);
if (direct) {
this.directOnlyPosition = -1;
}
} else {
this.checkedPositionList.add(position);
if (direct) {
this.directOnlyPosition = position.intValue();
}
}
notifyDataSetChanged();
}
}
}
示例2: onClick
import cn.sharesdk.onekeyshare.ShareCore; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
ViewHolder viewHolder = (ViewHolder) view.getTag();
Integer position = viewHolder.position;
//直接分享平台选中后,其它的不可用
if(directOnlyPosition != -1 && position != directOnlyPosition)
return;
Object item = getItem(position);
boolean direct = false;
//normal platform
if(item instanceof Platform){
direct = ShareCore.isDirectShare((Platform) item);
}else{
//自定义图标
direct = true;
}
//EditPage Platforms only
if(direct && directOnlyPosition == -1 && !checkedPositionList.isEmpty())
return;
if(checkedPositionList.contains(position)) {
checkedPositionList.remove(position);
if(direct)
directOnlyPosition = -1;
} else {
checkedPositionList.add(position);
if(direct)
directOnlyPosition = position;
}
notifyDataSetChanged();
}
示例3: getView
import cn.sharesdk.onekeyshare.ShareCore; //导入方法依赖的package包/类
public View getView(int position, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
Bitmap logo;
String label;
if (view == null) {
view = LayoutInflater.from(this.context).inflate(R.getLayoutRes(this.context, "skyblue_share_platform_list_item"), null);
viewHolder = new ViewHolder();
viewHolder.checkedImageView = (ImageView) view.findViewById(R.getIdRes(this.context, "checkedImageView"));
viewHolder.logoImageView = (ImageView) view.findViewById(R.getIdRes(this.context, "logoImageView"));
viewHolder.nameTextView = (TextView) view.findViewById(R.getIdRes(this.context, "nameTextView"));
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
}
CustomerLogo item = getItem(position);
boolean disabled = this.directOnlyPosition == -1 ? !this.checkedPositionList.isEmpty() && (item instanceof Platform ? ShareCore.isDirectShare((Platform) item) : true) : position != this.directOnlyPosition;
if (item instanceof Platform) {
logo = getIcon((Platform) item, disabled ? "" : "_checked");
label = getName((Platform) item);
view.setOnClickListener(this);
} else {
CustomerLogo customerLogo = item;
logo = disabled ? customerLogo.disableLogo : customerLogo.enableLogo;
label = customerLogo.label;
view.setOnClickListener(this);
}
String checkedResName = (this.directOnlyPosition == -1 || this.directOnlyPosition == position) ? "skyblue_platform_checked" : "skyblue_platform_checked_disabled";
viewHolder.position = Integer.valueOf(position);
viewHolder.checkedImageView.setImageBitmap(BitmapFactory.decodeResource(this.context.getResources(), R.getBitmapRes(this.context, checkedResName)));
viewHolder.checkedImageView.setVisibility(this.checkedPositionList.contains(viewHolder.position) ? 0 : 8);
viewHolder.nameTextView.setText(label);
viewHolder.logoImageView.setImageBitmap(logo);
return view;
}
示例4: getView
import cn.sharesdk.onekeyshare.ShareCore; //导入方法依赖的package包/类
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
if(view == null) {
view = LayoutInflater.from(context).inflate(getLayoutRes(context, "skyblue_share_platform_list_item"), null);
viewHolder = new ViewHolder();
viewHolder.checkedImageView = (ImageView) view.findViewById(getIdRes(context, "checkedImageView"));
viewHolder.logoImageView = (ImageView) view.findViewById(getIdRes(context, "logoImageView"));
viewHolder.nameTextView = (TextView) view.findViewById(getIdRes(context, "nameTextView"));
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
}
Bitmap logo;
String label;
Object item = getItem(position);
boolean disabled;
boolean isDirectShare = item instanceof Platform ? ShareCore.isDirectShare((Platform) item) : true;
if(directOnlyPosition == -1) {
disabled = !checkedPositionList.isEmpty() && isDirectShare;
} else {
disabled = position != directOnlyPosition;
}
if (item instanceof Platform) {
logo = getIcon((Platform) item, disabled ? "" : "_checked");
label = getName((Platform) item);
view.setOnClickListener(this);
} else {
CustomerLogo customerLogo = (CustomerLogo) item;
logo = disabled ? customerLogo.disableLogo : customerLogo.enableLogo;
label = customerLogo.label;
view.setOnClickListener(this);
//TODO 需要整理
// view.setOnClickListener(((CustomerLogo) item).listener);
}
String checkedResName = directOnlyPosition != -1 && directOnlyPosition != position ? "skyblue_platform_checked_disabled" : "skyblue_platform_checked";
viewHolder.position = position;
viewHolder.checkedImageView.setImageBitmap(BitmapFactory.decodeResource(context.getResources(), getBitmapRes(context, checkedResName)));
viewHolder.checkedImageView.setVisibility(checkedPositionList.contains(viewHolder.position) ? View.VISIBLE : View.GONE);
viewHolder.nameTextView.setText(label);
viewHolder.logoImageView.setImageBitmap(logo);
return view;
}
示例5: getView
import cn.sharesdk.onekeyshare.ShareCore; //导入方法依赖的package包/类
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
if(view == null) {
view = LayoutInflater.from(context).inflate(getLayoutRes(context, "ssdk_oks_skyblue_share_platform_list_item"), null);
viewHolder = new ViewHolder();
viewHolder.checkedImageView = (ImageView) view.findViewById(getIdRes(context, "checkedImageView"));
viewHolder.logoImageView = (ImageView) view.findViewById(getIdRes(context, "logoImageView"));
viewHolder.nameTextView = (TextView) view.findViewById(getIdRes(context, "nameTextView"));
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
}
Bitmap logo;
String label;
Object item = getItem(position);
boolean disabled;
boolean isDirectShare = item instanceof Platform ? ShareCore.isDirectShare((Platform) item) : true;
if(directOnlyPosition == -1) {
disabled = !checkedPositionList.isEmpty() && isDirectShare;
} else {
disabled = position != directOnlyPosition;
}
if (item instanceof Platform) {
logo = getIcon((Platform) item, disabled ? "" : "_checked");
label = getName((Platform) item);
view.setOnClickListener(this);
} else {
CustomerLogo customerLogo = (CustomerLogo) item;
logo = disabled ? customerLogo.disableLogo : customerLogo.enableLogo;
label = customerLogo.label;
view.setOnClickListener(this);
//TODO 需要整理
// view.setOnClickListener(((CustomerLogo) item).listener);
}
String checkedResName = directOnlyPosition != -1 && directOnlyPosition != position ? "ssdk_oks_skyblue_platform_checked_disabled" : "ssdk_oks_skyblue_platform_checked";
viewHolder.position = position;
viewHolder.checkedImageView.setImageBitmap(BitmapFactory.decodeResource(context.getResources(), getBitmapRes(context, checkedResName)));
viewHolder.checkedImageView.setVisibility(checkedPositionList.contains(viewHolder.position) ? View.VISIBLE : View.GONE);
viewHolder.nameTextView.setText(label);
viewHolder.logoImageView.setImageBitmap(logo);
return view;
}