本文整理汇总了Java中com.nispok.snackbar.listeners.ActionClickListener类的典型用法代码示例。如果您正苦于以下问题:Java ActionClickListener类的具体用法?Java ActionClickListener怎么用?Java ActionClickListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionClickListener类属于com.nispok.snackbar.listeners包,在下文中一共展示了ActionClickListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
})
);
}
示例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));
}
})
);
}
示例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));
}
})
);
}
示例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));
}
})
);
}
示例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());
}
}
示例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);
}
示例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));
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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)
);
}
示例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));
}
示例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();
}
示例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));
}
}