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

Java ActionClickListener类代码示例

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

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



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

示例1: Recarregar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void Recarregar()
{
    //Verifica se há internet
    if (Utils.haveInternet(getActivity())) {
        //Carrega as Faltas
        new DownloadJSON().execute(Utils.getUrlApiFalta(getActivity().getBaseContext()).replace("$rm",ActivityPrincipal.mAluno.getRm()).replace("$mes", String.valueOf(mes)));
    } else
        SnackbarManager.show(
                Snackbar.with(getActivity())
                        .text("Por favor verifique sua conexão com a Internet")
                        .type(SnackbarType.MULTI_LINE)
                        .actionLabel("CONECTAR")
                        .actionColor(getResources().getColor(R.color.colorAccent))
                        .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
                        .actionListener(new ActionClickListener() {
                            @Override
                            public void onActionClicked(Snackbar snackbar) {
                                //Inicia as configurações de rede
                                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                            }
                        })
        );
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:24,代码来源:FaltasLista.java


示例2: Recarregar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void Recarregar()
{
    //Verifica se há internet
    if (Utils.haveInternet(getActivity())) {
        //Carrega as Faltas
        new DownloadJSON().execute(Utils.getUrlApiNota(getActivity().getBaseContext()).replace("$rm",ActivityPrincipal.mAluno.getRm()).replace("$bim", String.valueOf(bimestre)));
    } else
        SnackbarManager.show(
                Snackbar.with(getActivity())
                        .text("Por favor verifique sua conexão com a Internet")
                        .type(SnackbarType.MULTI_LINE)
                        .actionLabel("CONECTAR")
                        .actionColor(getResources().getColor(R.color.colorAccent))
                        .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
                        .actionListener(new ActionClickListener() {
                            @Override
                            public void onActionClicked(Snackbar snackbar) {
                                //Inicia as configurações de rede
                                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                            }
                        })
        );
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:24,代码来源:NotasLista.java


示例3: Recarregar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void Recarregar()
{
    //Verifica se há internet
    if (Utils.haveInternet(getActivity())) {
        //Carrega as Faltas
        new DownloadJSON().execute(Utils.getUrlApiHorario(getActivity().getBaseContext(),true).replace("$turma", String.valueOf(ActivityPrincipal.mAluno.getIdTurma())).replace("$dia", String.valueOf(dia)));
    } else
        SnackbarManager.show(
                Snackbar.with(getActivity())
                        .text("Por favor verifique sua conexão com a Internet")
                        .type(SnackbarType.MULTI_LINE)
                        .actionLabel("CONECTAR")
                        .actionColor(getResources().getColor(R.color.colorAccent))
                        .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
                        .actionListener(new ActionClickListener() {
                            @Override
                            public void onActionClicked(Snackbar snackbar) {
                                //Inicia as configurações de rede
                                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                            }
                        })
        );
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:24,代码来源:HorarioLista.java


示例4: Recarregar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void Recarregar() {
    //Verifica se há internet
    if (Utils.haveInternet(getActivity())) {
        //Carrega as Notícias
        new DownloadNoticias(getActivity(), mRelativeLayout, mRecyclerView).execute(Utils.getUrlApiNoticia(getActivity()));
    } else
        SnackbarManager.show(
                Snackbar.with(getActivity())
                        .text("Por favor verifique sua conexão com a Internet")
                        .type(SnackbarType.MULTI_LINE)
                        .actionLabel("CONECTAR")
                        .actionColor(getResources().getColor(R.color.colorAccent))
                        .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
                        .actionListener(new ActionClickListener() {
                            @Override
                            public void onActionClicked(Snackbar snackbar) {
                                //Inicia as configurações de rede
                                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                            }
                        })
        );
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:23,代码来源:NoticiasLista.java


示例5: onPostExecute

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
@Override
protected void onPostExecute(BasicMessage<ArrayList<HomeBanner>> msg) {
	mBannerLoadingView.stopSpinning();
	mBannerLoadingView.setVisibility(View.INVISIBLE);
	if (msg != null && msg.getCode() == BasicMessage.CODE_SUCCEED) {
		mBannerIndicator.setVisibility(View.VISIBLE);

		mBannerAdapter = new BannerPagerAdapter(getChildFragmentManager(), msg.getObject());
		mBannerPager.setAdapter(mBannerAdapter);
		mBannerIndicator.setViewPager(mBannerPager);
	} else {
		Snackbar.with(getApplicationContext())
				.text(R.string.tips_cannot_get_banner)
				.actionLabel(R.string.snackbar_try_again)
				.actionColorResource(R.color.pink_500)
				.actionListener(new ActionClickListener() {
					@Override
					public void onActionClicked(Snackbar snackbar) {
						startBannerGetTask();
						snackbar.dismiss();
					}
				})
				.show(getSupportActivity());
	}
}
 
开发者ID:fython,项目名称:BiliNyan-Android,代码行数:26,代码来源:SectionHomeFragment.java


示例6: showInfo

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public void showInfo(final ApplicationInfo app) {
    SnackbarManager.show(
            Snackbar.with(getApplicationContext())
                    .actionColor(getResources().getColor(R.color.red))
                    .actionLabel(getString(R.string.undo))
                    .actionListener(new ActionClickListener() {
                        @Override
                        public void onActionClicked(Snackbar snackbar) {
                            blacklistedApp.add(app);
                            adapter.refresh(blacklistedApp.getBlacklistedAppList());
                            checkIfEmpty();
                        }
                    }) // action button's ActionClickListener
                    .text(getString(R.string.removed_from_blacklist, pm.getApplicationLabel(app))), this);
}
 
开发者ID:RomascuAndrei,项目名称:BTNotifierAndroid,代码行数:16,代码来源:ApplicationBlacklist.java


示例7: setupPushReceivedReceiver

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void setupPushReceivedReceiver() {
    pushReceivedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String title = intent.getExtras().getString("title");
            String body = intent.getExtras().getString("body");
            final String webUrl = intent.getExtras().getString("web_url");

            if (title != null && body != null && webUrl != null ) {
                // Using a 3rd party Snackbar because we can't extend
                // AppCompatActivity, thanks a lot XWalkActivity
                Snackbar snackbar = Snackbar.with(context)
                        .type(SnackbarType.MULTI_LINE)
                        .text(title + " " + body)
                        .actionLabel(R.string.view)
                        .actionListener(new ActionClickListener() {
                            @Override
                            public void onActionClicked(Snackbar snackbar) {
                                MainActivity.this.xWalkView.load(webUrl, null);
                            }
                        });
                SnackbarManager.show(snackbar);
            }
        }
    };
    registerReceiver(pushReceivedReceiver, new IntentFilter(ElloPreferences.PUSH_RECEIVED));
}
 
开发者ID:ello,项目名称:ello-android,代码行数:28,代码来源:MainActivity.java


示例8: setLoadFirstPageDataFailureView

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public void setLoadFirstPageDataFailureView(Context context, LayoutInflater inflater) {
		
		if(netErroView == null){
			netErroView = inflater.inflate(R.layout.common_paging_load_error_view, null);
		}
		
		if(loadingView == null){
			loadingView = inflater.inflate(R.layout.common_paging_load_view, null);
		}
		
//		RelativeLayout reloadBtn = (RelativeLayout) netErroView.findViewById(R.id.reload_btn);
//		reloadBtn.setOnClickListener(new OnClickListener() {
//			@Override
//			public void onClick(View v) {
//				loadListDataErrorViewWrapDelegate.addFirstPageReloadingView(loadingView);
//			}
//		});

		loadListDataErrorViewWrapDelegate.addLoadFirstPageDataFailureView(netErroView);
		SnackbarManager.show(
				Snackbar.with(context) // context
						.text("网络连接失败") // text to display
						.colorResource(R.color.app_black_color_transparent)
						.actionLabel("重新加载") // action button label
						.duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
						.dismissOnActionClicked(true)
						.actionListener(new ActionClickListener() {
							@Override
							public void onActionClicked(Snackbar snackbar) {
								loadListDataErrorViewWrapDelegate.addFirstPageReloadingView(loadingView);
							}
						})
		);// action button's ActionClickListener


//		Toast.makeText(context, context.getResources().getString(R.string.common_paging_network_failure_tip), Toast.LENGTH_SHORT).show();
		
	}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:39,代码来源:LoadListDataErrorViewWrap.java


示例9: showInfo

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public void showInfo(final ApplicationInfo app) {
    SnackbarManager.show(
            Snackbar.with(getApplicationContext())
                    .actionColor(getResources().getColor(R.color.main))
                    .actionLabel(getString(R.string.undo))
                    .actionListener(new ActionClickListener() {
                        @Override
                        public void onActionClicked(Snackbar snackbar) {
                            whitelistedApp.add(app);
                            adapter.refresh(whitelistedApp.getBlacklistedAppList());
                            checkIfEmpty();
                        }
                    }) // action button's ActionClickListener
                    .text(getString(R.string.app_removed, pm.getApplicationLabel(app))), this);
}
 
开发者ID:flyingrub,项目名称:MiBand-Notify,代码行数:16,代码来源:ApplicationList.java


示例10: showInfo

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public void showInfo(String text) {
    Snackbar.with(getApplicationContext())
            .text(text)
            .duration(Snackbar.SnackbarDuration.LENGTH_LONG)
            .actionLabel("Ok")
            .actionListener(new ActionClickListener() {
                @Override
                public void onActionClicked(Snackbar snackbar) {
                    Log.d(TAG, "TEST");
                }
            })
            .actionColor(getResources().getColor(R.color.accentColor))
            .show(this);
}
 
开发者ID:flyingrub,项目名称:TamTime,代码行数:15,代码来源:OneLineActivity.java


示例11: showSnackBar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
private void showSnackBar() {
    SnackbarManager.show(
            Snackbar.with(getApplicationContext()) // context
                    .text("Tap for list of stop times") // text to display
                    .actionLabel("GO") // action button label
                    .actionListener(new ActionClickListener() {
                        @Override
                        public void onActionClicked(Snackbar snackbar) {
                            showStopDetails();
                        }
                    })
            , this);
}
 
开发者ID:terell-brown-zz,项目名称:android-grand-river-transit-app,代码行数:14,代码来源:StopsMapActivity.java


示例12: showEnableWifiSnackbar

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public static void showEnableWifiSnackbar(Context context)
{
    SnackbarManager.show(
            Snackbar.with(context)
                    .type(SnackbarType.SINGLE_LINE)
                    .text(R.string.wifi_off_snackbar)
                    .swipeToDismiss(false)
                    .animation(false)
                    .color(Color.RED)
                    .actionLabel(R.string.enable_wifi)
                    .actionLabelTypeface(Typeface.DEFAULT_BOLD)
                    .actionListener(new ActionClickListener()
                    {
                        @Override
                        public void onActionClicked(Snackbar snackbar)
                        {
                            try
                            {
                                APL.enableWifi();
                            }
                            catch (Exception e)
                            {
                                Timber.e(e, "Exception during ActionsView enableWifiClickListener action");
                            }
                        }
                    })
                    .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
    );
}
 
开发者ID:shouldit,项目名称:android-proxy,代码行数:30,代码来源:UIUtils.java


示例13: backupDB

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public void backupDB(View view)
{
    final String filename = DBUtils.backupDB(this);
    SnackbarManager.show(
            Snackbar.with(this)
                    .type(SnackbarType.SINGLE_LINE)
                    .text(String.format("Saved on: '%s'", filename))
                    .swipeToDismiss(false)
                    .animation(false)
                    .color(Color.RED)
                    .actionLabel("OPEN")
                    .actionLabelTypeface(Typeface.DEFAULT_BOLD)
                    .actionListener(new ActionClickListener()
                    {
                        @Override
                        public void onActionClicked(Snackbar snackbar)
                        {
                            try
                            {
                                File fileToOpen = new File(filename);
                                Intent myIntent = new Intent();
                                myIntent.setAction(android.content.Intent.ACTION_VIEW);
                                myIntent.setDataAndType(Uri.fromFile(fileToOpen), "*/*");
                                startActivity(myIntent);
                            }
                            catch (Exception e)
                            {
                                Timber.e(e, "Exception during ActionsView enableWifiClickListener action");
                            }
                        }
                    })
                    .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE));
}
 
开发者ID:shouldit,项目名称:android-proxy,代码行数:34,代码来源:DeveloperOptionsActivity.java


示例14: showCharacteriscticsAuditObject

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
public static void showCharacteriscticsAuditObject(final Activity activity,final AuditObject auditObject, final UpdateAuditObjectCharacteristicsListener callback) {
    final SelectAuditObjectCharacteristicsDialogBuilder selectCharacteristicsBuilder = new SelectAuditObjectCharacteristicsDialogBuilder(activity, auditObject);
    final Response response = auditObject.getResponse();
    AlertDialog showCharacteristicsDialog = selectCharacteristicsBuilder
            .setTitle(com.orange.ocara.R.string.audit_object_characteristics_title)
            .setPositiveButton(com.orange.ocara.R.string.audit_object_characteristics_validate, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    List<AuditObject> characteristics = auditObject.getChildren(); // existing characteristics
                    List<ObjectDescription> selections = selectCharacteristicsBuilder.getSelectedCharacteristics(); // new selected characteristics

                    // build a list of new characteristics to create and associate to audit object
                    List<ObjectDescription> characteristicsToCreate = new ArrayList<ObjectDescription>();
                    for (ObjectDescription selectedObject : selections) {
                        if (!auditObject.hasCharacteristic(selectedObject.getName())) {
                            characteristicsToCreate.add(selectedObject);
                        }
                    }
                    // build a list of no more selected characteristics to remove from audit object
                    List<AuditObject> characteristicsToRemove = new ArrayList<AuditObject>();
                    for (AuditObject caracteristic : characteristics) {
                        ObjectDescription objectDescription = caracteristic.getObjectDescription();
                        if (!selections.contains(objectDescription)) {
                            characteristicsToRemove.add(caracteristic);
                        }
                    }
                    callback.onUpdateAuditObjectChildren(auditObject, characteristicsToCreate, characteristicsToRemove);


                    if (!response.equals(Response.NoAnswer) && !characteristicsToCreate.isEmpty()) {

                        SnackbarManager.show(
                                Snackbar.with(activity)
                                        .text(com.orange.ocara.R.string.info_retest)
                                        .type(SnackbarType.MULTI_LINE)
                                        .duration(Snackbar.SnackbarDuration.LENGTH_LONG)
                                        .backgroundDrawable(com.orange.ocara.R.color.white)
                                        .textColor(com.orange.ocara.R.color.black)
                                        .actionColorResource(com.orange.ocara.R.color.accent)
                                        .actionLabel(com.orange.ocara.R.string.action_retest)
                                        .actionListener(new ActionClickListener() {
                                            @Override
                                            public void onActionClicked(Snackbar snackbar) {
                                                callback.onLaunchAuditObjectsTestRequested(auditObject);
                                            }
                                        }),
                                (ViewGroup)activity.findViewById(android.R.id.content),
                                true
                        );
                    }
                }
            })
            .setNegativeButton(com.orange.ocara.R.string.action_back, null)
            .create();

    showCharacteristicsDialog.show();
}
 
开发者ID:Orange-OpenSource,项目名称:ocara,代码行数:58,代码来源:SelectAuditObjectCharacteristicsDialogBuilder.java


示例15: showWarning

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
protected void showWarning(CharSequence text, final View.OnClickListener listener, WarningType type) {
    View view = getView();
    Activity context = getActivity();
    if (view == null || context == null)
        return;

    Snackbar bar = SnackbarManager.getCurrentSnackbar();
    if (bar != null) {
        WarningType oldType = (WarningType) bar.getTag();
        if (oldType != null && oldType.getValue() > type.getValue())
            return;

        bar.dismiss();
    }

    bar = Snackbar.with(context)
        .type(SnackbarType.MULTI_LINE)
        .text(text)
        .duration(Snackbar.SnackbarDuration.LENGTH_INDEFINITE)
        .dismissOnActionClicked(false)
        .allowMultipleActionClicks(true);

    if (listener != null) {
        bar.swipeToDismiss(false)
            .actionLabel(R.string.warning_button_details)
            .actionListener(new ActionClickListener() {
                @Override
                public void onActionClicked(Snackbar snackbar) {
                    listener.onClick(null);
                }
            });
    }
    else {
        bar.swipeToDismiss(true)
            .animation(false);
    }

    int colorId = 0;
    int textColorId = 0;
    switch (type) {
        case FATAL:
            textColorId = R.color.warning_bar_text_fatal;
            colorId = R.color.warning_bar_background_fatal;
            break;
        case WARNING:
            textColorId = R.color.warning_bar_text_warning;
            colorId = R.color.warning_bar_background_warning;
            break;
    }

    bar.setTag(type);
    bar.color(ContextCompat.getColor(context, colorId))
        .textColor(ContextCompat.getColor(context, textColorId));

    if (listener != null) {
        SnackbarManager.show(bar);
    }
    else {
        SnackbarManager.show(bar, (ViewGroup) view.findViewById(R.id.warning_bar));
    }
}
 
开发者ID:kontalk,项目名称:androidclient,代码行数:62,代码来源:AbstractComposeFragment.java


示例16: actionListener

import com.nispok.snackbar.listeners.ActionClickListener; //导入依赖的package包/类
/**
 * Sets the listener to be called when the {@link Snackbar} action is
 * selected. Note that you must set a button label with
 * {@link Snackbar#actionLabel(CharSequence)} for this button to be displayed
 *
 * @param listener
 * @return
 */
public Snackbar actionListener(ActionClickListener listener) {
    mActionClickListener = listener;
    return this;
}
 
开发者ID:nispok,项目名称:snackbar,代码行数:13,代码来源:Snackbar.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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