本文整理汇总了Java中org.telegram.ui.ActionBar.BottomSheet.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java BottomSheet.Builder方法的具体用法?Java BottomSheet.Builder怎么用?Java BottomSheet.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.ui.ActionBar.BottomSheet
的用法示例。
在下文中一共展示了BottomSheet.Builder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shareMessage
import org.telegram.ui.ActionBar.BottomSheet; //导入方法依赖的package包/类
public void shareMessage(Context mContext, ArrayList<MessageObject> messages, boolean execludeName){
BottomSheet.Builder builder = new BottomSheet.Builder(mContext, true);
// check this
builder.setCustomView(new ShareFrameLayout(mContext, builder.create(), messages, execludeName));
builder.setUseFullWidth(false);
showDialog(builder.create());
}
示例2: openWebView
import org.telegram.ui.ActionBar.BottomSheet; //导入方法依赖的package包/类
private void openWebView(TLRPC.WebPage webPage) {
BottomSheet.Builder builder = new BottomSheet.Builder(getParentActivity());
builder.setCustomView(new WebFrameLayout(getParentActivity(), builder.create(), webPage.site_name, webPage.description, webPage.url, webPage.embed_url, webPage.embed_width, webPage.embed_height));
builder.setUseFullWidth(true);
showDialog(builder.create());
}
示例3: createMuteAlert
import org.telegram.ui.ActionBar.BottomSheet; //导入方法依赖的package包/类
public static Dialog createMuteAlert(Context context, final long dialog_id) {
if (context == null) {
return null;
}
BottomSheet.Builder builder = new BottomSheet.Builder(context);
builder.setTitle(LocaleController.getString("Notifications", R.string.Notifications));
CharSequence[] items = new CharSequence[]{
LocaleController.formatString("MuteFor", R.string.MuteFor, LocaleController.formatPluralString("Hours", 1)),
LocaleController.formatString("MuteFor", R.string.MuteFor, LocaleController.formatPluralString("Hours", 8)),
LocaleController.formatString("MuteFor", R.string.MuteFor, LocaleController.formatPluralString("Days", 2)),
LocaleController.getString("MuteDisable", R.string.MuteDisable)
};
builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
int untilTime = ConnectionsManager.getInstance().getCurrentTime();
if (i == 0) {
untilTime += 60 * 60;
} else if (i == 1) {
untilTime += 60 * 60 * 8;
} else if (i == 2) {
untilTime += 60 * 60 * 48;
} else if (i == 3) {
untilTime = Integer.MAX_VALUE;
}
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
long flags;
if (i == 3) {
editor.putInt("notify2_" + dialog_id, 2);
flags = 1;
} else {
editor.putInt("notify2_" + dialog_id, 3);
editor.putInt("notifyuntil_" + dialog_id, untilTime);
flags = ((long) untilTime << 32) | 1;
}
NotificationsController.getInstance().removeNotificationsForDialog(dialog_id);
MessagesStorage.getInstance().setDialogFlags(dialog_id, flags);
editor.commit();
TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id);
if (dialog != null) {
dialog.notify_settings = new TLRPC.TL_peerNotifySettings();
dialog.notify_settings.mute_until = untilTime;
}
NotificationsController.updateServerNotificationsSettings(dialog_id);
}
}
);
return builder.create();
}
示例4: createReportAlert
import org.telegram.ui.ActionBar.BottomSheet; //导入方法依赖的package包/类
public static Dialog createReportAlert(Context context, final long dialog_id, final BaseFragment parentFragment) {
if (context == null || parentFragment == null) {
return null;
}
BottomSheet.Builder builder = new BottomSheet.Builder(context);
builder.setTitle(LocaleController.getString("ReportChat", R.string.ReportChat));
CharSequence[] items = new CharSequence[]{
LocaleController.getString("ReportChatSpam", R.string.ReportChatSpam),
LocaleController.getString("ReportChatViolence", R.string.ReportChatViolence),
LocaleController.getString("ReportChatPornography", R.string.ReportChatPornography),
LocaleController.getString("ReportChatOther", R.string.ReportChatOther)
};
builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == 3) {
Bundle args = new Bundle();
args.putLong("dialog_id", dialog_id);
parentFragment.presentFragment(new ReportOtherActivity(args));
return;
}
TLRPC.TL_account_reportPeer req = new TLRPC.TL_account_reportPeer();
req.peer = MessagesController.getInputPeer((int) dialog_id);
if (i == 0) {
req.reason = new TLRPC.TL_inputReportReasonSpam();
} else if (i == 1) {
req.reason = new TLRPC.TL_inputReportReasonViolence();
} else if (i == 2) {
req.reason = new TLRPC.TL_inputReportReasonPornography();
}
ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
}
});
}
}
);
return builder.create();
}
示例5: run
import org.telegram.ui.ActionBar.BottomSheet; //导入方法依赖的package包/类
public void run() {
if (checkingForLongPress && windowView != null) {
checkingForLongPress = false;
windowView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
if (pressedLink != null) {
final String urlFinal = pressedLink.getUrl();
BottomSheet.Builder builder = new BottomSheet.Builder(parentActivity);
builder.setTitle(urlFinal);
builder.setItems(new CharSequence[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy)}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, final int which) {
if (parentActivity == null) {
return;
}
if (which == 0) {
Browser.openUrl(parentActivity, urlFinal);
} else if (which == 1) {
String url = urlFinal;
if (url.startsWith("mailto:")) {
url = url.substring(7);
} else if (url.startsWith("tel:")) {
url = url.substring(4);
}
AndroidUtilities.addToClipboard(url);
}
}
});
showDialog(builder.create());
hideActionBar();
pressedLink = null;
pressedLinkOwnerLayout = null;
pressedLinkOwnerView.invalidate();
} else if (pressedLinkOwnerLayout != null && pressedLinkOwnerView != null) {
int y = pressedLinkOwnerView.getTop() - AndroidUtilities.dp(54) + pressedLayoutY;
int x;
if (y < 0) {
y *= -1;
}
pressedLinkOwnerView.invalidate();
drawBlockSelection = true;
showPopup(pressedLinkOwnerView, Gravity.TOP, 0, y);
listView.setLayoutFrozen(true);
listView.setLayoutFrozen(false);
}
}
}