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

Java PaletteUtils类代码示例

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

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



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

示例1: handleLoginCallback

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
public void handleLoginCallback(Uri uri) {
    //Use the parameter your API exposes for the code (mostly it's "code")
    String code = uri.getQueryParameter(BuildConfig.RESPONSE_TYPE);
    if(code != null) {
        TokenReference tokenReference = new TokenReference(mActivity);
        if(tokenReference.AuthorizeNewToken(code)) {
            getAppPrefs().setUserAuthenticated();
            ServiceGenerator.authStateChange(mActivity);
            reference = new Authorize();
            reference.execute();
        }
        else
            createSuperToast(mActivity, mActivity.getString(R.string.text_error_capture_login), R.drawable.ic_info_outline_white_18dp,
                    Style.TYPE_STANDARD, Style.DURATION_VERY_LONG,
                    PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_AMBER));
    } else if ((code = uri.getQueryParameter("error")) != null)
        createSuperToast(mActivity, code, R.drawable.ic_info_outline_white_18dp,
                Style.TYPE_STANDARD, Style.DURATION_VERY_LONG,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED));
    else
        createSuperToast(mActivity, mActivity.getString(R.string.text_error_auth_login), R.drawable.ic_info_outline_white_18dp,
                Style.TYPE_STANDARD, Style.DURATION_VERY_LONG,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_AMBER));
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:25,代码来源:LoginPresenter.java


示例2: onBackPressed

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
public void onBackPressed() {
    if (mDrawer.isDrawerOpen(GravityCompat.START))
        mDrawer.closeDrawer(GravityCompat.START);
    else if(mFilterBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED)
        mFilterBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    else if(!isClosing) {
        isClosing = true;
        mPresenter.createSuperToast(MainActivity.this,
                getString(R.string.text_confirm_exit),
                R.drawable.ic_info_outline_white_18dp,
                Style.TYPE_STANDARD, Style.DURATION_MEDIUM,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_TEAL));
    }
    else
        super.onBackPressed();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:18,代码来源:MainActivity.java


示例3: onClick

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * When Material Dialog on click occurs
 */
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {

    if(mNavigationIndex == R.id.nav_anime || mNavigationIndex == R.id.nav_manga || mNavigationIndex == R.id.nav_myanime || mNavigationIndex == R.id.nav_mymanga || mNavigationIndex == R.id.nav_hub) {
        mPresenter.createSuperToast(MainActivity.this,
                getString(R.string.text_filter_applying),
                R.drawable.ic_reset,
                Style.TYPE_PROGRESS_BAR, Style.DURATION_VERY_SHORT,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_CYAN));
    } else {
        mPresenter.createSuperToast(MainActivity.this,
                getString(R.string.text_filter_restriction),
                R.drawable.ic_info_outline_white_18dp,
                Style.TYPE_STANDARD, Style.DURATION_VERY_SHORT,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_ORANGE));
    }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:21,代码来源:MainActivity.java


示例4: updateUI

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
protected void updateUI() {
    if(mImages == null) {
        SuperActivityToast.create(this, new com.github.johnpersano.supertoasts.library.Style(), com.github.johnpersano.supertoasts.library.Style.TYPE_STANDARD)
                .setText(getString(R.string.layout_empty_response))
                .setTypefaceStyle(Typeface.NORMAL)
                .setIconPosition(com.github.johnpersano.supertoasts.library.Style.ICONPOSITION_LEFT)
                .setIconResource(R.drawable.ic_close_24dp)
                .setDuration(com.github.johnpersano.supertoasts.library.Style.DURATION_MEDIUM)
                .setFrame(com.github.johnpersano.supertoasts.library.Style.FRAME_STANDARD)
                .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED))
                .setAnimations(com.github.johnpersano.supertoasts.library.Style.ANIMATIONS_SCALE).show();
    } else {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
        mRecyclerView.setAdapter(new PreviewImageAdapter(mImages, mTypes, this));
        mCardScaleHelper = new CardScaleHelper();
        mCardScaleHelper.attachToRecyclerView(mRecyclerView);
    }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:20,代码来源:GalleryPreviewActivity.java


示例5: updateUI

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
protected void updateUI() {
    if((imageURL = getIntent().getStringExtra(IMAGE_SOURCE)) != null){
        Glide.with(this).load(imageURL)
                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                .into(mImageView);
    }
    else {
        SuperActivityToast.create(this, new com.github.johnpersano.supertoasts.library.Style(), com.github.johnpersano.supertoasts.library.Style.TYPE_STANDARD)
                .setText("Sorry, could not resolve content!")
                .setTypefaceStyle(Typeface.NORMAL)
                .setIconPosition(com.github.johnpersano.supertoasts.library.Style.ICONPOSITION_LEFT)
                .setIconResource(R.drawable.ic_close_24dp)
                .setDuration(com.github.johnpersano.supertoasts.library.Style.DURATION_MEDIUM)
                .setFrame(com.github.johnpersano.supertoasts.library.Style.FRAME_STANDARD)
                .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED))
                .setAnimations(com.github.johnpersano.supertoasts.library.Style.ANIMATIONS_SCALE).show();
    }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:20,代码来源:ImagePreviewActivity.java


示例6: onBackPressed

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Take care of popping the fragment back stack or finishing the activity
 * as appropriate.
 */
@Override
public void onBackPressed() {
    if(mBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED)
        mBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    else if(editText.hasFocus())
        editText.clearFocus();
    else if(!isClosing) {
        isClosing = true;
        mPresenter.createSuperToast(ComposerActivity.this,
                getString(R.string.text_confirm_exit),
                R.drawable.ic_info_outline_white_18dp,
                Style.TYPE_STANDARD, Style.DURATION_MEDIUM,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_TEAL));
    }
    else
        super.onBackPressed();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:22,代码来源:ComposerActivity.java


示例7: saveGenres

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
public void saveGenres(Integer[] which, CharSequence[] text, Activity mContext) {
    String genres = "";
    createSuperToast(mContext,
            mContext.getString(R.string.text_filter_applying),
            R.drawable.ic_reset,
            Style.TYPE_PROGRESS_BAR, Style.DURATION_MEDIUM,
            PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_CYAN));

    for (CharSequence temp: text) {
        if(genres.isEmpty())
            genres += String.format("%s",temp);
        else
            genres += String.format(",%s",temp);
    }

    for (Integer index: which)
        indexGenres.add(String.valueOf(index));

    // Save the built list
    getApiPrefs().saveGenres(genres);
    getApiPrefs().saveGenresIndices(indexGenres);
    //notifyAllItems();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:24,代码来源:CommonPresenter.java


示例8: getColor

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
public static int getColor(Context context) {
    switch (PreferenceManager.getDefaultSharedPreferences(context).getInt(context
            .getResources().getString(R.string.color_title), 0)) {
        case 0: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED);
        case 1: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_PINK);
        case 2: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_PURPLE);
        case 3: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_DEEP_PURPLE);
        case 4: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_INDIGO);
        case 5: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE);
        case 6: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_LIGHT_BLUE);
        case 7: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_CYAN);
        case 8: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_TEAL);
        case 9: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREEN);
        case 10: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_LIGHT_GREEN);
        case 11: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_LIME);
        case 12: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_YELLOW);
        case 13: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_AMBER);
        case 14: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_ORANGE);
        case 15: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_DEEP_ORANGE);
        case 16: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN);
        case 17: return PaletteUtils.getSolidColor(PaletteUtils.GREY);
        case 18: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE_GREY);
        default: return PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE_GREY);
    }
}
 
开发者ID:JohnPersano,项目名称:SuperToasts,代码行数:26,代码来源:AttributeUtils.java


示例9: checkStatus

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Runs once to check if users has youtube installed
 */
private void checkStatus(){
    if(!YouTubeIntents.canResolvePlayVideoIntent(this))
    {
        mPresenter.createSuperToast(MainActivity.this,
                getString(R.string.init_youtube_missing),
                R.drawable.ic_play_circle_outline_white_24dp,
                Style.TYPE_STANDARD, Style.DURATION_VERY_LONG,
                PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE_GREY));
    }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:14,代码来源:MainActivity.java


示例10: displayMessage

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
public void displayMessage(String message, Context activity) {
    SuperActivityToast.create(activity, new com.github.johnpersano.supertoasts.library.Style(), Style.TYPE_STANDARD)
                      .setText(String.format(Locale.getDefault(), " %s", message))
                      .setTypefaceStyle(Typeface.NORMAL)
                      .setIconPosition(Style.ICONPOSITION_LEFT)
                      .setIconResource(R.drawable.ic_info_outline_white_18dp)
                      .setDuration(Style.DURATION_VERY_SHORT)
                      .setFrame(Style.FRAME_STANDARD)
                      .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE))
                      .setAnimations(Style.ANIMATIONS_FADE).show();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:12,代码来源:CharacterActivity.java


示例11: createSuperToast

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Show super toast from an activity
 * <br/>
 * @param mContext Activity calling this method.
 * @param mText Desired message to display
 * @param mIcon Drawable preferred 24dp vectors will also work
 * @param mType Style.TYPE type of the toast
 *
 * <br/>
 * @see com.github.johnpersano.supertoasts.library.Style for toast duration & style
 */
public void createSuperToast(Activity mContext, String mText, @DrawableRes int mIcon, @Style.Type int mType) {
    mToast = SuperActivityToast.create(mContext, new Style(), mType)
            .setText(" "+mText) //add a space for the icon
            .setTypefaceStyle(Typeface.NORMAL)
            .setIconPosition(Style.ICONPOSITION_LEFT)
            .setIconResource(mIcon)
            .setDuration(Style.DURATION_VERY_SHORT)
            .setFrame(Style.FRAME_LOLLIPOP)
            .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_CYAN))
            .setAnimations(Style.ANIMATIONS_FLY);
    mToast.show();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:24,代码来源:CommonPresenter.java


示例12: showSyncToCalendarSuccessful

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
public void showSyncToCalendarSuccessful() {
    DialogFactory.createSuperToast(
            this,
            getResources().getString(R.string.settings_calendar_sync_successful),
            PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREEN))
            .show();
}
 
开发者ID:schul-cloud,项目名称:schulcloud-mobile-android,代码行数:9,代码来源:SettingsActivity.java


示例13: showFileDeleteSuccess

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
public void showFileDeleteSuccess() {
    DialogFactory.createSuperToast(getContext(),
            getResources().getString(R.string.files_delete_success_file),
            PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREEN)).show();
    reloadFiles();
}
 
开发者ID:schul-cloud,项目名称:schulcloud-mobile-android,代码行数:8,代码来源:FileFragment.java


示例14: showDirectoryDeleteSuccess

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
@Override
public void showDirectoryDeleteSuccess() {
    DialogFactory.createSuperToast(getContext(),
            getResources().getString(R.string.files_delete_success_directory),
            PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREEN)).show();
    reloadFiles();
}
 
开发者ID:schul-cloud,项目名称:schulcloud-mobile-android,代码行数:8,代码来源:FileFragment.java


示例15: Style

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Public constructor for a new {@link Style}.
 * This constructor will assign a few default values.
 */
public Style() {
    // General SuperToast items
    this.duration = DURATION_MEDIUM;
    this.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREY);
    this.gravity = Gravity.BOTTOM | Gravity.CENTER;
    this.yOffset = BackgroundUtils.convertToDIP(64);
    this.width = FrameLayout.LayoutParams.WRAP_CONTENT;
    this.height = FrameLayout.LayoutParams.WRAP_CONTENT;
    this.priorityLevel = PRIORITY_MEDIUM;

    // Message TextView items
    this.messageTypefaceStyle = Typeface.NORMAL;
    this.messageTextColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.messageTextSize = TEXTSIZE_SMALL;
    this.messageIconPosition = ICONPOSITION_LEFT;

    // SuperActivityToast Button items
    this.buttonTypefaceStyle = Typeface.BOLD;
    this.buttonTextColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.buttonTextSize = TEXTSIZE_VERY_SMALL;
    this.buttonDividerColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);

    //SuperActivityToast Progress items
    this.progressBarColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.progressIndeterminate = true;
}
 
开发者ID:heshshark,项目名称:ToastUI,代码行数:31,代码来源:Style.java


示例16: lime

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Default material lime transparent style for SuperToasts.
 * @return A new Style
 */
public static Style lime() {
    final Style style = new Style();
    style.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_LIME);
    style.messageTextColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    style.buttonDividerColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    style.buttonTextColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    return style;
}
 
开发者ID:heshshark,项目名称:ToastUI,代码行数:13,代码来源:Style.java


示例17: yellow

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Default material yellow transparent style for SuperToasts.
 * @return A new Style
 */
public static Style yellow() {
    final Style style = new Style();
    style.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_YELLOW);
    style.messageTextColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    style.buttonDividerColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    style.buttonTextColor = PaletteUtils.getSolidColor(PaletteUtils.DARK_GREY);
    return style;
}
 
开发者ID:heshshark,项目名称:ToastUI,代码行数:13,代码来源:Style.java


示例18: rottenBanana

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Default material rotten banana transparent style for SuperToasts.
 * @return A new Style
 */
public static Style rottenBanana() {
    final Style style = new Style();
    style.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_YELLOW);
    style.frame = FRAME_LOLLIPOP;
    style.messageTextColor = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN);
    style.buttonDividerColor = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN);
    style.buttonTextColor = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN);
    style.priorityColor = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN);
    return style;
}
 
开发者ID:heshshark,项目名称:ToastUI,代码行数:15,代码来源:Style.java


示例19: Style

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Public constructor for a new {@link com.github.johnpersano.supertoasts.library.Style}.
 * This constructor will assign a few default values.
 */
public Style() {
    // General SuperToast items
    this.duration = DURATION_MEDIUM;
    this.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_GREY);
    this.gravity = Gravity.BOTTOM | Gravity.CENTER;
    this.yOffset = BackgroundUtils.convertToDIP(64);
    this.width = FrameLayout.LayoutParams.WRAP_CONTENT;
    this.height = FrameLayout.LayoutParams.WRAP_CONTENT;
    this.priorityLevel = PRIORITY_MEDIUM;

    // Message TextView items
    this.messageTypefaceStyle = Typeface.NORMAL;
    this.messageTextColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.messageTextSize = TEXTSIZE_SMALL;
    this.messageIconPosition = ICONPOSITION_LEFT;

    // SuperActivityToast Button items
    this.buttonTypefaceStyle = Typeface.BOLD;
    this.buttonTextColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.buttonTextSize = TEXTSIZE_VERY_SMALL;
    this.buttonDividerColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);

    //SuperActivityToast Progress items
    this.progressBarColor = PaletteUtils.getSolidColor(PaletteUtils.WHITE);
    this.progressIndeterminate = true;
}
 
开发者ID:JohnPersano,项目名称:SuperToasts,代码行数:31,代码来源:Style.java


示例20: red

import com.github.johnpersano.supertoasts.library.utils.PaletteUtils; //导入依赖的package包/类
/**
 * Default material red transparent style for SuperToasts.
 * @return A new Style
 */
public static Style red() {
    final Style style = new Style();
    style.color = PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED);
    return style;
}
 
开发者ID:heshshark,项目名称:ToastUI,代码行数:10,代码来源:Style.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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