Search in sources :

Example 11 with CardView

use of android.support.v7.widget.CardView in project FanLayoutManager by Cleveroad.

the class SportCardsAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(final SportCardViewHolder holder, int position) {
    SportCardModel item = mItems.get(position);
    holder.tvSportTitle.setText(item.getSportTitle());
    holder.tvSportSubtitle.setText(item.getSportSubtitle());
    holder.tvSportRound.setText(item.getSportRound());
    holder.ivSportPreview.setImageResource(item.getImageResId());
    holder.tvTime.setText(item.getTime());
    holder.tvDayPart.setText(item.getDayPart());
    ((CardView) holder.itemView).setCardBackgroundColor(ContextCompat.getColor(mContext, item.getBackgroundColorResId()));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        holder.ivSportPreview.setTransitionName("shared" + String.valueOf(position));
    }
    holder.itemView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mOnItemClickListener != null) {
                mOnItemClickListener.onItemClicked(holder.getAdapterPosition(), holder.ivSportPreview);
            }
        }
    });
}
Also used : SportCardModel(com.cleveroad.testrecycler.models.SportCardModel) CardView(android.support.v7.widget.CardView) CardView(android.support.v7.widget.CardView) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 12 with CardView

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

the class SecurityActivity method setPasswordDialog.

private void setPasswordDialog() {
    final AlertDialog.Builder passwordDialog = new AlertDialog.Builder(SecurityActivity.this, getDialogStyle());
    final View PasswordDialogLayout = getLayoutInflater().inflate(org.horaapps.leafpic.R.layout.dialog_set_password, null);
    final TextView passwordDialogTitle = (TextView) PasswordDialogLayout.findViewById(org.horaapps.leafpic.R.id.password_dialog_title);
    final CardView passwordDialogCard = (CardView) PasswordDialogLayout.findViewById(org.horaapps.leafpic.R.id.password_dialog_card);
    final EditText editTextPassword = (EditText) PasswordDialogLayout.findViewById(org.horaapps.leafpic.R.id.password_edittxt);
    final EditText editTextConfirmPassword = (EditText) PasswordDialogLayout.findViewById(org.horaapps.leafpic.R.id.confirm_password_edittxt);
    passwordDialogTitle.setBackgroundColor(getPrimaryColor());
    passwordDialogCard.setBackgroundColor(getCardBackgroundColor());
    editTextPassword.getBackground().mutate().setColorFilter(getTextColor(), PorterDuff.Mode.SRC_ATOP);
    editTextPassword.setTextColor(getTextColor());
    editTextPassword.setHintTextColor(getSubTextColor());
    setCursorDrawableColor(editTextPassword, getTextColor());
    editTextConfirmPassword.getBackground().mutate().setColorFilter(getTextColor(), PorterDuff.Mode.SRC_ATOP);
    editTextConfirmPassword.setTextColor(getTextColor());
    editTextConfirmPassword.setHintTextColor(getSubTextColor());
    setCursorDrawableColor(editTextConfirmPassword, getTextColor());
    passwordDialog.setView(PasswordDialogLayout);
    AlertDialog dialog = passwordDialog.create();
    dialog.setCancelable(false);
    dialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(org.horaapps.leafpic.R.string.cancel).toUpperCase(), new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            swActiveSecurity.setChecked(false);
            SP.putBoolean(getString(org.horaapps.leafpic.R.string.preference_use_password), false);
        }
    });
    dialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(org.horaapps.leafpic.R.string.ok_action).toUpperCase(), new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            boolean changed = false;
            if (editTextPassword.length() > 3) {
                if (editTextPassword.getText().toString().equals(editTextConfirmPassword.getText().toString())) {
                    SP.putString(getString(org.horaapps.leafpic.R.string.preference_password_value), editTextPassword.getText().toString());
                    securityObj.updateSecuritySetting();
                    Toast.makeText(getApplicationContext(), org.horaapps.leafpic.R.string.remember_password_message, Toast.LENGTH_SHORT).show();
                    changed = true;
                } else
                    Toast.makeText(getApplicationContext(), org.horaapps.leafpic.R.string.password_dont_match, Toast.LENGTH_SHORT).show();
            } else
                Toast.makeText(getApplicationContext(), org.horaapps.leafpic.R.string.error_password_length, Toast.LENGTH_SHORT).show();
            swActiveSecurity.setChecked(changed);
            SP.putBoolean(getString(org.horaapps.leafpic.R.string.preference_use_password), changed);
            toggleEnabledChild(changed);
        }
    });
    dialog.show();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) EditText(android.widget.EditText) DialogInterface(android.content.DialogInterface) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) View(android.view.View)

Example 13 with CardView

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

the class SettingsActivity method customizePictureViewer.

private void customizePictureViewer() {
    final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this, getDialogStyle());
    View dialogLayout = getLayoutInflater().inflate(R.layout.dialog_media_viewer_theme, null);
    final SwitchCompat swApplyTheme_Viewer = (SwitchCompat) dialogLayout.findViewById(R.id.apply_theme_3th_act_enabled);
    ((CardView) dialogLayout.findViewById(R.id.third_act_theme_card)).setCardBackgroundColor(getCardBackgroundColor());
    //or GetPrimary
    dialogLayout.findViewById(R.id.third_act_theme_title).setBackgroundColor(getPrimaryColor());
    ((TextView) dialogLayout.findViewById(R.id.apply_theme_3thAct_title)).setTextColor(getTextColor());
    ((TextView) dialogLayout.findViewById(R.id.apply_theme_3thAct_title_Sub)).setTextColor(getSubTextColor());
    ((IconicsImageView) dialogLayout.findViewById(R.id.ll_apply_theme_3thAct_icon)).setColor(getIconColor());
    swApplyTheme_Viewer.setChecked(isApplyThemeOnImgAct());
    swApplyTheme_Viewer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            updateSwitchColor(swApplyTheme_Viewer, getAccentColor());
        }
    });
    updateSwitchColor(swApplyTheme_Viewer, getAccentColor());
    final LineColorPicker transparencyColorPicker = (LineColorPicker) dialogLayout.findViewById(R.id.pickerTransparent);
    transparencyColorPicker.setColors(ColorPalette.getTransparencyShadows(getPrimaryColor()));
    transparencyColorPicker.setSelectedColor(ColorPalette.getTransparentColor(getPrimaryColor(), getTransparency()));
    /**TEXT VIEWS**/
    ((TextView) dialogLayout.findViewById(R.id.seek_bar_alpha_title)).setTextColor(getTextColor());
    ((TextView) dialogLayout.findViewById(R.id.seek_bar_alpha_title_Sub)).setTextColor(getSubTextColor());
    dialogBuilder.setView(dialogLayout);
    dialogBuilder.setNeutralButton(getString(R.string.cancel).toUpperCase(), null);
    dialogBuilder.setPositiveButton(getString(R.string.ok_action).toUpperCase(), new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            SharedPreferences.Editor editor = SP.getEditor();
            editor.putBoolean(getString(R.string.preference_apply_theme_pager), swApplyTheme_Viewer.isChecked());
            int c = Color.alpha(transparencyColorPicker.getColor());
            editor.putInt(getString(R.string.preference_transparency), 255 - c);
            editor.commit();
            updateTheme();
        }
    });
    dialogBuilder.show();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface) CardView(android.support.v7.widget.CardView) View(android.view.View) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) LineColorPicker(uz.shift.colorpicker.LineColorPicker) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) TextView(android.widget.TextView) CompoundButton(android.widget.CompoundButton) SwitchCompat(android.support.v7.widget.SwitchCompat)

Example 14 with CardView

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

the class AlertDialogsHelper method getInsertTextDialog.

public static AlertDialog getInsertTextDialog(final ThemedActivity activity, AlertDialog.Builder dialogBuilder, EditText editText, @StringRes int title) {
    View dialogLayout = activity.getLayoutInflater().inflate(org.horaapps.leafpic.R.layout.dialog_insert_text, null);
    TextView textViewTitle = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.rename_title);
    ((CardView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.dialog_chose_provider_title)).setCardBackgroundColor(activity.getCardBackgroundColor());
    textViewTitle.setBackgroundColor(activity.getPrimaryColor());
    textViewTitle.setText(title);
    ThemeHelper.setCursorDrawableColor(editText, activity.getTextColor());
    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    editText.setLayoutParams(layoutParams);
    editText.setSingleLine(true);
    editText.getBackground().mutate().setColorFilter(activity.getTextColor(), PorterDuff.Mode.SRC_IN);
    editText.setTextColor(activity.getTextColor());
    try {
        Field f = TextView.class.getDeclaredField("mCursorDrawableRes");
        f.setAccessible(true);
        f.set(editText, null);
    } catch (Exception ignored) {
    }
    ((RelativeLayout) dialogLayout.findViewById(org.horaapps.leafpic.R.id.container_edit_text)).addView(editText);
    dialogBuilder.setView(dialogLayout);
    return dialogBuilder.create();
}
Also used : Field(java.lang.reflect.Field) FrameLayout(android.widget.FrameLayout) CardView(android.support.v7.widget.CardView) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView)

Example 15 with CardView

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

the class AlertDialogsHelper method getTextDialog.

public static AlertDialog getTextDialog(final ThemedActivity activity, AlertDialog.Builder textDialogBuilder, @StringRes int title, @StringRes int Message) {
    View dialogLayout = activity.getLayoutInflater().inflate(org.horaapps.leafpic.R.layout.dialog_text, null);
    TextView dialogTitle = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.text_dialog_title);
    TextView dialogMessage = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.text_dialog_message);
    ((CardView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.message_card)).setCardBackgroundColor(activity.getCardBackgroundColor());
    dialogTitle.setBackgroundColor(activity.getPrimaryColor());
    dialogTitle.setText(title);
    dialogMessage.setText(Message);
    dialogMessage.setTextColor(activity.getTextColor());
    textDialogBuilder.setView(dialogLayout);
    return textDialogBuilder.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)

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