當前位置: 首頁>>代碼示例>>Java>>正文


Java LovelyCustomDialog類代碼示例

本文整理匯總了Java中com.yarolegovich.lovelydialog.LovelyCustomDialog的典型用法代碼示例。如果您正苦於以下問題:Java LovelyCustomDialog類的具體用法?Java LovelyCustomDialog怎麽用?Java LovelyCustomDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LovelyCustomDialog類屬於com.yarolegovich.lovelydialog包,在下文中一共展示了LovelyCustomDialog類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newProjectDialog

import com.yarolegovich.lovelydialog.LovelyCustomDialog; //導入依賴的package包/類
private void newProjectDialog() {

        mProjectDialog = new LovelyCustomDialog(this, mDarkTheme ? R.style.EditTextTintThemeDark : R.style.EditTextTintTheme)
                .setView(R.layout.project_form)
                .setTopColor(mPrimaryColor)
                .setIcon(R.drawable.ic_notepad)
                .setListener(R.id.projectDoneButton, new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        createProjectFromDialog();
                    }
                })
                .show();

        //get the views
        mProjectError = (TextView) mProjectDialog.findViewById(R.id.project_error_message);
        mProjectField = (EditText) mProjectDialog.findViewById(R.id.editProjectName);

        //hide error when text change
        mProjectField.addTextChangedListener(this);
        mProjectField.setHighlightColor(Color.LTGRAY);
        mProjectField.setOnFocusChangeListener(this);

        //request focus on the edit text
        if (mProjectField.requestFocus()) {
            mProjectDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
        }

    }
 
開發者ID:IdeaTrackerPlus,項目名稱:IdeaTrackerPlus,代碼行數:30,代碼來源:MainActivity.java

示例2: setupDialogs

import com.yarolegovich.lovelydialog.LovelyCustomDialog; //導入依賴的package包/類
private void setupDialogs() {
    AnimatedRecyclerView movesList = new AnimatedRecyclerView(context);
    movesList.setLayoutManager(new LinearLayoutManager(context));
    movesList.setHasFixedSize(true);
    movesList.setAdapter(new MoveListAdapter(context, profile.getMoves()));

    movesDialog = new LovelyCustomDialog(context)
            .setTopColorRes(R.color.colorPrimary)
            .setTitle(R.string.moveset)
            .setIcon(R.drawable.ic_book_white_24dp)
            .setView(movesList)
            .setCancelable(true);

    PokemonListItem[] evolutions = profile.getEvolutions();

    AnimatedRecyclerView evolutionsList = new AnimatedRecyclerView(context);
    evolutionsList.setLayoutManager(new LinearLayoutManager(context));
    evolutionsList.setHasFixedSize(true);
    evolutionsList.setAdapter(new PokemonListAdapter(context, evolutions, true));

    evolutionsDialog = new LovelyCustomDialog(context)
            .setTopColorRes(R.color.colorPrimary)
            .setView(evolutionsList)
            .setIcon(R.drawable.ic_group_work_white_24dp)
            .setCancelable(true);

    if (evolutions.length == 0) {
        evolutionsDialog.setTitle(context.getString(R.string.no_evolutions));
        evolutionsDialog.setMessage(String.format(context.getString(R.string.no_evolutions_message),
                profile.getName()));
    }
    else {
        evolutionsDialog.setTitle(context.getString(R.string.evolutions));
    }
}
 
開發者ID:tylerbwong,項目名稱:Pokebase,代碼行數:36,代碼來源:PokemonInfoView.java

示例3: showItemDialog

import com.yarolegovich.lovelydialog.LovelyCustomDialog; //導入依賴的package包/類
private void showItemDialog() {
    Context context = view.getContext();
    DatabaseOpenHelper databaseHelper = DatabaseOpenHelper.getInstance(context);

    int imageResourceId = context.getResources().getIdentifier(item.getIdentifier(),
            DRAWABLE, context.getPackageName());

    String cost = String.valueOf(item.getCost());
    String description;

    if (item.getDescription() == null) {
        description = databaseHelper.queryItemDescription(item.getId());
        item.setDescription(description);
    }
    else {
        description = item.getDescription();
    }

    if (cost.equals(NONE)) {
        cost = NA;
    }

    ItemInfoView infoView = new ItemInfoView(context);
    infoView.setFields(cost, imageResourceId, description);

    new LovelyCustomDialog(view.getContext())
            .setCancelable(true)
            .setTopColorRes(R.color.colorPrimary)
            .setIcon(R.drawable.ic_business_center_white_24dp)
            .setTitle(item.getName())
            .setView(infoView)
            .show();
}
 
開發者ID:tylerbwong,項目名稱:Pokebase,代碼行數:34,代碼來源:ItemListItemViewHolder.java

示例4: showFontDetailsDialog

import com.yarolegovich.lovelydialog.LovelyCustomDialog; //導入依賴的package包/類
public void showFontDetailsDialog(Context context, String title, String message, double rating,
                                  int ratingCount) {
    LayoutInflater inflater = (LayoutInflater)
            context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    final View viewFontDetails = inflater.inflate(R.layout.dialog_font_details, null);

    //To make sure Font FileName doesn't end up as a clickable url because it is automatically
    //turned into a url
    final SpannableString content = new SpannableString(message);
    Linkify.addLinks(content, Patterns.WEB_URL, null, new Linkify.MatchFilter() {
        @Override
        public boolean acceptMatch(CharSequence seq, int start, int end) {
            String url = seq.subSequence(start, end).toString();
            //Apply the default matcher too. This will remove filenames that matched.
            return !url.contains(".ttf") && Linkify.sUrlMatchFilter
                    .acceptMatch(seq, start, end);
        }
    }, null);

    TextView tvMessage = (TextView) viewFontDetails
            .findViewById(R.id.text_font_details_message);
    if (tvMessage != null) {
        tvMessage.setText(content);
        tvMessage.setMovementMethod(LinkMovementMethod.getInstance()); //Making link clickable
        tvMessage.setLinkTextColor(ContextCompat.getColor(context, R.color.blue));
    }

    final Dialog dialog = new LovelyCustomDialog(context)
            .setView(viewFontDetails)
            .setTopColorRes(R.color.colorPrimaryLight)
            .setTitle(title)
            .setIcon(R.drawable.ic_info_outline)
            .show();
    TextView btnGotIt = (TextView) viewFontDetails.findViewById(R.id.button_font_details_got_it);
    btnGotIt.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (dialog != null && dialog.isShowing()) {
                dialog.dismiss();
            }
        }
    });
    TextView tvRating = (TextView) viewFontDetails.findViewById(R.id.tv_rating);
    Resources res = getResources();
    String text = res.getQuantityString(R.plurals.dialog_font_rating, ratingCount,
            formatToOneDecimalPlace(rating),
            formatToOneDecimalPlace(res.getInteger(R.integer.rating_max_possible_value)),
            ratingCount);
    tvRating.setText(text);
}
 
開發者ID:wahibhaq,項目名稱:urdu-font-comparator-app,代碼行數:51,代碼來源:MainFragment.java


注:本文中的com.yarolegovich.lovelydialog.LovelyCustomDialog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。