本文整理匯總了Java中de.keyboardsurfer.android.widget.crouton.Crouton.cancelAllCroutons方法的典型用法代碼示例。如果您正苦於以下問題:Java Crouton.cancelAllCroutons方法的具體用法?Java Crouton.cancelAllCroutons怎麽用?Java Crouton.cancelAllCroutons使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.keyboardsurfer.android.widget.crouton.Crouton
的用法示例。
在下文中一共展示了Crouton.cancelAllCroutons方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onMapClick
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
/**
* This callback is executed when a click occurs somewhere in map.
* If there is
* @param point
*/
@Override
public void onMapClick(LatLng point) {
if(expectingLocation){
Crouton.cancelAllCroutons();
expectingLocation=false;
if(expectingAction == ACTION_NEW_PIN){
new EditPinDialog(this, new Place(point.latitude, point.longitude), this).show();
expectingAction = ACTION_NONE;
}
else if(expectingAction == ACTION_GET_ORIGIN){
new ReverseGeocodingTask(getBaseContext()).execute(point.latitude, point.longitude);
}
else if(expectingAction == ACTION_GET_DESTINATION){
new ReverseGeocodingTask(getBaseContext()).execute(point.latitude, point.longitude);
}
}
else{
removeSelectedMarker();
}
}
示例2: onQuerySuccess
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
/**
* Ответ от сервера
* @param res
*/
@Override
public void onQuerySuccess(ShikiStatusResult res) {
if(activity == null)
return;
activity.getAC().getLoaderController().hide();
// success auth
if(res.isSuccess() && activity.getAC().getShikiUser().getId()!=null){
activity.startActivity(new Intent(activity, MainActivity.class));
activity.finish();
// error auth
} else if(res.isError() && !TextUtils.isEmpty(res.getMsg())){
Crouton.cancelAllCroutons();
Crouton.makeText(activity, res.getMsg(), Style.ALERT).show();
}
}
示例3: onPause
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public void onPause() {
super.onPause();
commitPending();
stopJingles();
Crouton.cancelAllCroutons();
// Clears data structures
// selectedNotes.clear();
if (mAdapter != null) {
mAdapter.clearSelectedItems();
}
listView.clearChoices();
if (mActionMode != null) {
mActionMode.finish();
}
}
示例4: display
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
/**
* Method used to display message in an activity
*
* @param pActivity
* activity
* @param msg
* @param success
*/
public static void display(final Activity pActivity, final CharSequence msg, final CoutonColor coutonColor) {
int color = 0;
switch (coutonColor) {
case GREEN:
color = pActivity.getResources().getColor(R.color.green_success);
break;
case ORANGE:
color = pActivity.getResources().getColor(R.color.orange);
break;
case BLACK:
default:
color = pActivity.getResources().getColor(R.color.black_error);
}
// Remove all previous crouton
Crouton.cancelAllCroutons();
// Build style
Style style = new Style.Builder().setBackgroundColorValue(color) //
.setPaddingDimensionResId(R.dimen.crouton_padding) //
.setGravity(Gravity.CENTER) //
.setTextAppearance(R.style.Crouton_TextApparence) //
.build();
Crouton.showText(pActivity, msg, style, R.id.crouton);
}
示例5: onOptionsItemSelected
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
if (mActionBarDrawerToggle.onOptionsItemSelected(item)) {
Crouton.cancelAllCroutons();
return true;
}
return super.onOptionsItemSelected(item);
}
示例6: prepareCamera
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
public static void prepareCamera(Activity ctx) {
try {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri mImageCaptureUri;
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
if (Uri.fromFile(CroperinoFileUtil.newCameraFile()) != null) {
if (Build.VERSION.SDK_INT >= 23) {
mImageCaptureUri = FileProvider.getUriForFile(ctx,
ctx.getApplicationContext().getPackageName() + ".provider",
CroperinoFileUtil.newCameraFile());
} else {
mImageCaptureUri = Uri.fromFile(CroperinoFileUtil.newCameraFile());
}
} else {
mImageCaptureUri = FileProvider.getUriForFile(ctx,
ctx.getApplicationContext().getPackageName() + ".provider",
CroperinoFileUtil.newCameraFile());
}
} else {
mImageCaptureUri = InternalStorageContentProvider.CONTENT_URI;
}
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri);
intent.putExtra("return-data", true);
ctx.startActivityForResult(intent, CroperinoConfig.REQUEST_TAKE_PHOTO);
} catch (Exception e) {
Crouton.cancelAllCroutons();
if (e instanceof ActivityNotFoundException) {
Crouton.makeText(ctx, "Activity not found", Style.ALERT).show();
} else if (e instanceof IOException) {
Crouton.makeText(ctx, "Image file captured not found", Style.ALERT).show();
} else {
Crouton.makeText(ctx, "Camera access failed", Style.ALERT).show();
}
}
}
示例7: onPause
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public void onPause() {
super.onPause();
searchQueryInstant = searchQuery;
stopJingles();
Crouton.cancelAllCroutons();
if (!keepActionMode) {
commitPending();
list.clearChoices();
if (getActionMode() != null) {
getActionMode().finish();
}
}
}
示例8: onUndo
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public void onUndo(Parcelable undoToken) {
// Cycles removed items to re-insert into adapter
for (Note note : modifiedNotes) {
// Manages uncategorize or archive undo
if ((undoCategorize && !Navigation.checkNavigationCategory(undoCategoryMap.get(note)))
|| undoArchive && !Navigation.checkNavigation(Navigation.NOTES)) {
if (undoCategorize) {
note.setCategory(undoCategoryMap.get(note));
} else if (undoArchive) {
note.setArchived(undoArchivedMap.get(note));
}
listAdapter.replace(note, listAdapter.getPosition(note));
// Manages trash undo
} else {
list.insert(undoNotesList.keyAt(undoNotesList.indexOfValue(note)), note);
}
}
listAdapter.notifyDataSetChanged();
selectedNotes.clear();
undoNotesList.clear();
modifiedNotes.clear();
undoTrash = false;
undoArchive = false;
undoCategorize = false;
undoNotesList.clear();
undoCategoryMap.clear();
undoArchivedMap.clear();
undoCategorizeCategory = null;
Crouton.cancelAllCroutons();
if (getActionMode() != null) {
getActionMode().finish();
}
ubc.hideUndoBar(false);
fab.showFab();
}
示例9: onPause
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
protected void onPause() {
super.onPause();
Crouton.cancelAllCroutons();
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
}
示例10: onDestroy
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public void onDestroy() {
LOGI(TAG, "onDestroy()");
Crouton.cancelAllCroutons();
try {
MainThreadBus.get().unregister(this);
} catch (Throwable t) {
LOGE(TAG, "Unable to unregister from Otto.", t);
}
super.onDestroy();
}
示例11: onPause
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
protected void onPause() {
super.onPause();
m_eventBus.unregister(this);
Crouton.cancelAllCroutons();
dismissDialog();
}
示例12: onDestroy
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
/**
* Clean the file cache when root activity exits.
*/
@Override
protected void onDestroy() {
super.onDestroy();
if (BuildConfig.DEBUG) Log.d(getLogTag(), "onDestroy");
Crouton.cancelAllCroutons();
}
示例13: show
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
/**
* Show a usage tip via an INFO style crouton. Tips are shown once per session unless the
* force param is true.
* @param activity
* @param tip
* @param force
*/
public void show(Activity activity, String tip, boolean force) {
SharedPreferences defaultSharedPrefs =
PreferenceManager.getDefaultSharedPreferences(activity);
boolean enable = defaultSharedPrefs.getBoolean(Constants.KEY_ENABLE_USAGE_TIPS, false);
if (!enable) {
if (BuildConfig.DEBUG) Log.d(TAG, "Usage tips disabled in preferences");
return;
}
if (!force && !mShownTips.contains(tip)) {
Crouton.cancelAllCroutons();
Crouton.makeText(activity, tip, Style.INFO).show();
mShownTips.add(tip);
}
}
示例14: onDestroy
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
protected void onDestroy() {
Crouton.cancelAllCroutons();
super.onDestroy();
}
示例15: onDestroy
import de.keyboardsurfer.android.widget.crouton.Crouton; //導入方法依賴的package包/類
@Override
public void onDestroy() {
this.cancelRequests();
Crouton.cancelAllCroutons();
}