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();
}
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);
}
}
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);
}
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;
}
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;
}
Aggregations