• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SuperActivityToast类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onKeyDown

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
            if ((System.currentTimeMillis() - exitTime) > 3000) {
//                TToast.show(getResources().getString(R.string.exit_once_more_hint));
//                Snackbar.make(mContainer,R.string.exit_once_more_hint,Snackbar.LENGTH_SHORT).show();
                SuperActivityToast.create(this, getResources().getString(R.string.exit_once_more_hint),
                        SuperToast.Duration.SHORT, Style.getStyle(Style.BLUE, SuperToast.Animations.FLYIN)).show();
                exitTime = System.currentTimeMillis();
            } else {
                finish();
            }
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
 
开发者ID:MiracleWong,项目名称:MWZhiHuDaily,代码行数:18,代码来源:MainActivity.java


示例2: login

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@OnClick(R.id.submit)
public void login(View view) {
    String un = username.getText().toString();
    String pw = password.getText().toString();
    OtherUtils.hideSoftKeyboard(getActivity(), password);
    L.i("login ", un);
    SuperActivityToast superActivityToast = new SuperActivityToast(getActivity(),
            SuperToast.Type.PROGRESS);
    superActivityToast.setText("登录中...");
    superActivityToast.show();
    ZGYWikiHelper.helper.login(un, pw)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(success -> {
                superActivityToast.dismiss();
                pageManager.pop(LoginPage.this);
                myObservable.notifyObservers(success);
            },
                    failure -> {
                        L.e(failure);
                        superActivityToast.dismiss();
                        SuperToast.create(getActivity(), "登录失败", Duration.SHORT).show();
                    });
}
 
开发者ID:bwzz,项目名称:yyl,代码行数:24,代码来源:LoginPage.java


示例3: makeInfoToast

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public static SuperActivityToast  makeInfoToast(Activity activity, String message) {
	SuperActivityToast.cancelAllSuperActivityToasts();
	Logger.d(TAG, "Making Info Toast");

	SuperActivityToast superActivityToast = new SuperActivityToast(activity,
			SuperToast.Type.STANDARD);

	superActivityToast.setAnimations(SuperToast.Animations.FADE);
	superActivityToast.setDuration(SuperToast.Duration.SHORT);
	superActivityToast.setBackground(SuperToast.Background.GREEN);
	superActivityToast.setText(message);
	superActivityToast.setTextSize(SuperToast.TextSize.MEDIUM);
	superActivityToast.setIcon(SuperToast.Icon.Dark.INFO, SuperToast.IconPosition.LEFT);

	superActivityToast.show();
	return superActivityToast;
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:18,代码来源:ToastUtils.java


示例4: makeWarningToast

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public static SuperActivityToast  makeWarningToast(Activity activity, String message) {
	SuperActivityToast.cancelAllSuperActivityToasts();
	Logger.d(TAG, "Making Warning Toast");

	SuperActivityToast superActivityToast = new SuperActivityToast(activity,
			SuperToast.Type.STANDARD);

	superActivityToast.setAnimations(SuperToast.Animations.FADE);
	superActivityToast.setDuration(SuperToast.Duration.SHORT);
	superActivityToast.setBackground(SuperToast.Background.ORANGE);
	superActivityToast.setText(message);
	superActivityToast.setTextSize(SuperToast.TextSize.MEDIUM);
	superActivityToast.setIcon(SuperToast.Icon.Dark.EXIT, SuperToast.IconPosition.LEFT);

	superActivityToast.show();
	return superActivityToast;
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:18,代码来源:ToastUtils.java


示例5: onItemClick

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> adapter, View view, int position,
		long id) {
	StringBuilder sb = new StringBuilder();
	sb.append(contactList.get(position).getContactDevice());
	sb.append(CustomConstants.LINE_SEPARATOR);
	sb.append(contactList.get(position).getDeviceID());

	mSelectionPosition = position;
	
	SuperActivityToast.cancelAllSuperActivityToasts();
	
	SuperActivityToast superActivityToast = new SuperActivityToast(this,  SuperToast.Type.BUTTON);
	superActivityToast.setDuration(SuperToast.Duration.LONG);
	superActivityToast.setText(sb.toString());
	superActivityToast.setButtonIcon(SuperToast.Icon.Dark.EXIT, "DELETE");
	superActivityToast.setOnClickWrapper(onClickWrapper);
	superActivityToast.show();
	
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:21,代码来源:ListDisplayActivity.java


示例6: showSuperSnapshotSaved

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public static void showSuperSnapshotSaved(final Activity activity, final Uri uri)
{
    /**
     * The OnClickWrapper is needed to reattach SuperToast.OnClickListeners on orientation
     * changes.
     * It does this via a unique String tag defined in the first parameter so each
     * OnClickWrapper's tag
     * should be unique.
     */
    OnClickWrapper onClickWrapper = new OnClickWrapper("snapshotsavedtoast",
            new SuperToast.OnClickListener()
    {

        @Override
        public void onClick(View view, Parcelable token)
        {
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            activity.startActivity(intent);
        }
    });

    SuperToast.cancelAllSuperToasts();
    SuperActivityToast superActivityToast = new SuperActivityToast(activity,
            SuperToast.Type.BUTTON);
    superActivityToast.setDuration(SuperToast.Duration.EXTRA_LONG);
    superActivityToast.setText(activity.getString(R.string.msg_snapshot_saved));
    superActivityToast.setButtonIcon(R.drawable.icon_gallery, activity.getString(R.string
            .view_in_gallery));
    superActivityToast.setOnClickWrapper(onClickWrapper);
    superActivityToast.show();
}
 
开发者ID:GNUDimarik,项目名称:evercam-play-android2,代码行数:32,代码来源:CustomToast.java


示例7: showSuperToastShort

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public static void showSuperToastShort(Activity activity, int message)
{
    SuperActivityToast.cancelAllSuperActivityToasts();
    SuperToast superToast = new SuperToast(activity);
    superToast.setDuration(SuperToast.Duration.SHORT);
    superToast.setText(activity.getString(message));
    superToast.show();
}
 
开发者ID:GNUDimarik,项目名称:evercam-play-android2,代码行数:9,代码来源:CustomToast.java


示例8: progress

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
private void progress() {
    hideSoftInputFromWindow();
    SuperActivityToast.cancelAllSuperActivityToasts();
    SuperActivityToast superActivityToast = new SuperActivityToast(HomeActivity.this, SuperToast.Type.PROGRESS);
    superActivityToast.setText("Progressing...");
    superActivityToast.setIndeterminate(true);
    superActivityToast.setProgressIndeterminate(true);
    superActivityToast.show();
}
 
开发者ID:yongjhih,项目名称:drupalfit,代码行数:10,代码来源:HomeActivity.java


示例9: dismissToast

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public static void dismissToast(SuperActivityToast superActivityToast) {
	if (superActivityToast != null ) {
		Logger.d(TAG, "Dismissing Toast");
		superActivityToast.dismiss();
		SuperActivityToast.cancelAllSuperActivityToasts();
	}
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:8,代码来源:ToastUtils.java


示例10: onPause

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
/**
 * Called when activity gets invisible
 */
@Override
protected void onPause() {
	super.onPause();
	// Cancel all toasts currently showing
	SuperActivityToast.cancelAllSuperActivityToasts();
	disableBluetoothScan();
	removeReceivers();
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:12,代码来源:MainActivity.java


示例11: onResume

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@Override
protected void onResume() {
	super.onResume();
	checkForConfigFile();

	// Cancel all toasts currently showing
	SuperActivityToast.cancelAllSuperActivityToasts();

	if (mNfcToggleButton.isChecked()) {
		enableNFCForegroundMode();
	}
	if (mIBeaconToggleButton.isChecked()) {
		enableBluetoothScan();
	}
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:16,代码来源:MainActivity.java


示例12: addCourse

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
private void addCourse() {
    InputMethodManager imm = (InputMethodManager) editText_courseName.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    if (imm.isActive())
        imm.hideSoftInputFromWindow(editText_courseName.getApplicationWindowToken(), 0);
    String slug = editText_courseName.getText().toString().trim();
    TXRestClientUsage.getProjectDetails(slug);
    Log.i(TAG, slug);
    editText_courseName.setText("");
    SuperActivityToast.create(ProjectActivity.this, "下载" + slug, SuperToast.Duration.LONG).show();
}
 
开发者ID:edu-infinity,项目名称:eduinfinity-translateHelper,代码行数:11,代码来源:ProjectActivity.java


示例13: done

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
private void done() {
    SuperActivityToast.cancelAllSuperActivityToasts();
}
 
开发者ID:yongjhih,项目名称:drupalfit,代码行数:4,代码来源:HomeActivity.java


示例14: disableForegroundMode

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
public void disableForegroundMode() {
	Logger.d(TAG, "disableForegroundMode");
	SuperActivityToast.cancelAllSuperActivityToasts();
	mNfcAdapter.disableForegroundDispatch(this);
}
 
开发者ID:MikeFot,项目名称:Android--Event-Triggered-Skype-Caller,代码行数:6,代码来源:WriteNFCActivity.java


示例15: getGenericArticleDialog

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
/**
 * {@link com.afollestad.materialdialogs.MaterialDialog} used to display generic
 * article options.
 *
 * @param context         A valid {@link android.content.Context}
 * @param articleListItem The {@link uk.org.crimetalk.adapters.items.ArticleListItem} that
 *                        called the MaterialDialog
 * @return {@link com.afollestad.materialdialogs.MaterialDialog.Builder}
 * @see {@link uk.org.crimetalk.fragments.ArticleListFragment}
 */
public static MaterialDialog.Builder getGenericArticleDialog(final Context context, final ArticleListItem articleListItem) {

    return new MaterialDialog.Builder(context)
            .title(context.getResources().getString(R.string.dialog_generic_article_title))
            .items(context.getResources().getStringArray(R.array.dialog_generic_article_items))
            .itemsCallback(new MaterialDialog.ListCallback() {

                @Override
                public void onSelection(MaterialDialog dialog, View view, int selection, CharSequence text) {

                    switch (selection) {

                        case 0:

                            final Intent shareIntent = new Intent();
                            shareIntent.setAction(Intent.ACTION_SEND);
                            shareIntent.putExtra(Intent.EXTRA_SUBJECT, context.getResources().getString(R.string.check_out_article));
                            shareIntent.putExtra(Intent.EXTRA_TEXT, articleListItem.getLink());
                            shareIntent.setType("text/plain");
                            context.startActivity(Intent.createChooser(shareIntent, context.getResources().getText(R.string.share_via)));

                            break;

                        case 1:

                            final Intent intent = new Intent(Intent.ACTION_VIEW);
                            intent.setData(Uri.parse(articleListItem.getLink()));
                            context.startActivity(intent);

                            break;

                        case 2:

                            final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
                            final ClipData clipData = ClipData.newPlainText("article", String.format(context.getResources()
                                    .getString(R.string.clipboard_article), articleListItem.getTitle(), articleListItem.getAuthor(), articleListItem.getLink()));
                            clipboard.setPrimaryClip(clipData);

                            SuperActivityToast.create((Activity) context, context.getResources().getString(R.string.clipboard_toast),
                                    SuperToast.Duration.SHORT, Style.getStyle(Style.RED)).show();

                            break;

                    }

                }

            });

}
 
开发者ID:JohnPersano,项目名称:CrimeTalk-Reader,代码行数:61,代码来源:DialogUtils.java


示例16: onOptionsItemSelected

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {

        case android.R.id.home:

            this.finish();

            return true;

        case R.id.action_rate:

            // Without the 'try' statement this could crash if the Play store is not found on the device
            try {

                final Intent rateIntent = new Intent(Intent.ACTION_VIEW);
                rateIntent.setData(Uri.parse(RATE_URL));
                startActivity(rateIntent);

            } catch (ActivityNotFoundException activityNotFoundException) {

                SuperActivityToast.create(AboutActivity.this, "Play store not found!", SuperToast.Duration.LONG).show();

            }

            return true;

        case R.id.action_faq:

            final Intent faqIntent = new Intent(Intent.ACTION_VIEW);
            faqIntent.setData(Uri.parse(FAQ_URL));
            startActivity(faqIntent);

            return true;

        case R.id.action_issue:

            final Intent issueIntent = new Intent(Intent.ACTION_VIEW);
            issueIntent.setData(Uri.parse(ISSUE_URL));
            startActivity(issueIntent);

            return true;

        case R.id.action_contact:

            final Intent contactIntent = new Intent(Intent.ACTION_VIEW);
            contactIntent.setData(Uri.parse(CONTACT_URL));
            startActivity(contactIntent);
            return true;

    }

    return false;

}
 
开发者ID:JohnPersano,项目名称:CrimeTalk-Reader,代码行数:57,代码来源:AboutActivity.java


示例17: onOptionsItemSelected

import com.github.johnpersano.supertoasts.SuperActivityToast; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    final ArticleListItem articleListItem = getIntent().getExtras().getParcelable(ArticleContentActivity.ARG_LIST_ITEM);

    switch (item.getItemId()) {

        case android.R.id.home:

            this.finish();

            return true;

        case R.id.action_share:

            final Intent shareIntent = new Intent();
            shareIntent.setAction(Intent.ACTION_SEND);
            shareIntent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.check_out_article));
            shareIntent.putExtra(Intent.EXTRA_TEXT, articleListItem.getLink());
            shareIntent.setType("text/plain");
            startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.share_via)));

            return true;

        case R.id.action_browser:

            final Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse(articleListItem.getLink()));
            startActivity(intent);

            return true;

        case R.id.action_clipboard:

            final ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
            final ClipData clipData = ClipData.newPlainText("article", String.format(getResources()
                    .getString(R.string.clipboard_article), articleListItem.getTitle(), articleListItem.getAuthor(), articleListItem.getLink()));
            clipboard.setPrimaryClip(clipData);

            SuperActivityToast.create(this, getResources().getString(R.string.clipboard_toast),
                    SuperToast.Duration.SHORT, Style.getStyle(Style.RED)).show();

            return true;

    }

    return false;

}
 
开发者ID:JohnPersano,项目名称:CrimeTalk-Reader,代码行数:50,代码来源:ArticleContentActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ImageDecoder类代码示例发布时间:2022-05-23
下一篇:
Java Constraint类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap