Search in sources :

Example 16 with CardView

use of android.support.v7.widget.CardView in project LeafPic by HoraApps.

the class AlertDialogsHelper method getProgressDialog.

public static AlertDialog getProgressDialog(final ThemedActivity activity, AlertDialog.Builder progressDialog, String title, String message) {
    View dialogLayout = activity.getLayoutInflater().inflate(org.horaapps.leafpic.R.layout.dialog_progress, null);
    TextView dialogTitle = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.progress_dialog_title);
    TextView dialogMessage = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.progress_dialog_text);
    dialogTitle.setBackgroundColor(activity.getPrimaryColor());
    ((CardView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.progress_dialog_card)).setCardBackgroundColor(activity.getCardBackgroundColor());
    ((ProgressBar) dialogLayout.findViewById(org.horaapps.leafpic.R.id.progress_dialog_loading)).getIndeterminateDrawable().setColorFilter(activity.getPrimaryColor(), android.graphics.PorterDuff.Mode.SRC_ATOP);
    dialogTitle.setText(title);
    dialogMessage.setText(message);
    dialogMessage.setTextColor(activity.getTextColor());
    progressDialog.setCancelable(false);
    progressDialog.setView(dialogLayout);
    return progressDialog.create();
}
Also used : CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView)

Example 17 with CardView

use of android.support.v7.widget.CardView in project android_frameworks_base by crdroidandroid.

the class RecentsTvView method launchTaskFomRecents.

/**
     * Launch the given task from recents with animation. If the task is not focused, this will
     * attempt to scroll to focus the task before launching.
     * @param task
     */
private void launchTaskFomRecents(final Task task, boolean animate) {
    if (!animate) {
        SystemServicesProxy ssp = Recents.getSystemServices();
        ssp.startActivityFromRecents(getContext(), task.key, task.title, null);
        return;
    }
    mTaskStackHorizontalView.requestFocus();
    Task focusedTask = mTaskStackHorizontalView.getFocusedTask();
    if (focusedTask != null && task != focusedTask) {
        if (mScrollListener != null) {
            mTaskStackHorizontalView.removeOnScrollListener(mScrollListener);
        }
        mScrollListener = new OnScrollListener() {

            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                super.onScrollStateChanged(recyclerView, newState);
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
                    TaskCardView cardView = mTaskStackHorizontalView.getChildViewForTask(task);
                    if (cardView != null) {
                        mTransitionHelper.launchTaskFromRecents(mStack, task, mTaskStackHorizontalView, cardView, null, INVALID_STACK_ID);
                    } else {
                        // This should not happen normally. If this happens then the data in
                        // the grid view was altered during the scroll. Log error and launch
                        // task with no animation.
                        Log.e(TAG, "Card view for task : " + task + ", returned null.");
                        SystemServicesProxy ssp = Recents.getSystemServices();
                        ssp.startActivityFromRecents(getContext(), task.key, task.title, null);
                    }
                    mTaskStackHorizontalView.removeOnScrollListener(mScrollListener);
                }
            }
        };
        mTaskStackHorizontalView.addOnScrollListener(mScrollListener);
        mTaskStackHorizontalView.setSelectedPositionSmooth(((TaskStackHorizontalViewAdapter) mTaskStackHorizontalView.getAdapter()).getPositionOfTask(task));
    } else {
        mTransitionHelper.launchTaskFromRecents(mStack, task, mTaskStackHorizontalView, mTaskStackHorizontalView.getChildViewForTask(task), null, INVALID_STACK_ID);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) Task(com.android.systemui.recents.model.Task) OnScrollListener(android.support.v7.widget.RecyclerView.OnScrollListener) RecyclerView(android.support.v7.widget.RecyclerView)

Example 18 with CardView

use of android.support.v7.widget.CardView in project material-sheet-fab by gowong.

the class NotesAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    Note noteModel = notes[position];
    String title = noteModel.getTitle();
    String note = noteModel.getNote();
    String info = noteModel.getInfo();
    int infoImage = noteModel.getInfoImage();
    int color = noteModel.getColor();
    // Set text
    holder.titleTextView.setText(title);
    holder.noteTextView.setText(note);
    holder.infoTextView.setText(info);
    // Set image
    if (infoImage != 0) {
        holder.infoImageView.setImageResource(infoImage);
    }
    // Set visibilities
    holder.titleTextView.setVisibility(TextUtils.isEmpty(title) ? View.GONE : View.VISIBLE);
    holder.noteTextView.setVisibility(TextUtils.isEmpty(note) ? View.GONE : View.VISIBLE);
    holder.infoLayout.setVisibility(TextUtils.isEmpty(info) ? View.GONE : View.VISIBLE);
    // Set padding
    int paddingTop = (holder.titleTextView.getVisibility() != View.VISIBLE) ? 0 : holder.itemView.getContext().getResources().getDimensionPixelSize(R.dimen.note_content_spacing);
    holder.noteTextView.setPadding(holder.noteTextView.getPaddingLeft(), paddingTop, holder.noteTextView.getPaddingRight(), holder.noteTextView.getPaddingBottom());
    // Set background color
    ((CardView) holder.itemView).setCardBackgroundColor(color);
}
Also used : Note(com.gordonwong.materialsheetfab.sample.models.Note) CardView(android.support.v7.widget.CardView)

Example 19 with CardView

use of android.support.v7.widget.CardView in project MaterialIntroView by iammert.

the class GravityFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_gravity, container, false);
    cardView1 = (CardView) view.findViewById(R.id.my_card);
    cardView2 = (CardView) view.findViewById(R.id.my_card2);
    cardView3 = (CardView) view.findViewById(R.id.my_card3);
    showIntro(cardView1, INTRO_CARD1, "This intro focuses on RIGHT", FocusGravity.RIGHT);
    return view;
}
Also used : CardView(android.support.v7.widget.CardView) View(android.view.View) MaterialIntroView(co.mobiwise.materialintro.view.MaterialIntroView) Nullable(android.support.annotation.Nullable)

Example 20 with CardView

use of android.support.v7.widget.CardView in project MaterialIntroView by iammert.

the class MainFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.content_main, container, false);
    cardView = (CardView) view.findViewById(R.id.my_card);
    button = (Button) view.findViewById(R.id.button_reset_all);
    button.setOnClickListener(this);
    //Show intro
    showIntro(cardView, INTRO_CARD, "This is card! Hello There. You can set this text!");
    return view;
}
Also used : CardView(android.support.v7.widget.CardView) View(android.view.View) MaterialIntroView(co.mobiwise.materialintro.view.MaterialIntroView) Nullable(android.support.annotation.Nullable)

Aggregations

CardView (android.support.v7.widget.CardView)30 View (android.view.View)26 TextView (android.widget.TextView)24 ImageView (android.widget.ImageView)10 IconicsImageView (com.mikepenz.iconics.view.IconicsImageView)10 DialogInterface (android.content.DialogInterface)9 AlertDialog (android.support.v7.app.AlertDialog)9 RecyclerView (android.support.v7.widget.RecyclerView)9 ScrollView (android.widget.ScrollView)8 OnScrollListener (android.support.v7.widget.RecyclerView.OnScrollListener)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5 Task (com.android.systemui.recents.model.Task)5 Intent (android.content.Intent)3 Nullable (android.support.annotation.Nullable)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 EditText (android.widget.EditText)3 SeekBar (android.widget.SeekBar)3 NonNull (android.support.annotation.NonNull)2 SwitchCompat (android.support.v7.widget.SwitchCompat)2 CompoundButton (android.widget.CompoundButton)2