Search in sources :

Example 1 with Theme

use of us.koller.cameraroll.themes.Theme in project Camera-Roll-Android-App by kollerlukas.

the class MainAdapter method onCreateViewHolder.

@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    RecyclerView.ViewHolder viewHolder;
    viewHolder = style.createViewHolderInstance(parent);
    if (viewHolder instanceof NestedRecyclerViewAlbumHolder) {
        ((NestedRecyclerViewAlbumHolder) viewHolder).setSelectorModeManager(getSelectorManager());
    }
    Context context = viewHolder.itemView.getContext();
    Theme theme = Settings.getInstance(context).getThemeInstance(context);
    ThemeableActivity.checkTags((ViewGroup) viewHolder.itemView, theme);
    return viewHolder;
}
Also used : NestedRecyclerViewAlbumHolder(us.koller.cameraroll.adapter.main.viewHolder.NestedRecyclerViewAlbumHolder) Context(android.content.Context) Theme(us.koller.cameraroll.themes.Theme) RecyclerView(android.support.v7.widget.RecyclerView) NonNull(android.support.annotation.NonNull)

Example 2 with Theme

use of us.koller.cameraroll.themes.Theme in project Camera-Roll-Android-App by kollerlukas.

the class Style method setColumnCountButtonsClickListener.

void setColumnCountButtonsClickListener(final View view) {
    final TextView columnCountTV = view.findViewById(R.id.column_count);
    columnCountTV.setText(String.valueOf(getColumnCount(view.getContext())));
    View.OnClickListener clickListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            int columnCount = getColumnCount(v.getContext());
            switch(v.getId()) {
                case R.id.minus:
                    if (columnCount > 1) {
                        columnCount--;
                    }
                    break;
                case R.id.plus:
                    columnCount++;
                    break;
                default:
                    break;
            }
            setColumnCount(v.getContext(), columnCount);
            columnCountTV.setText(String.valueOf(columnCount));
        }
    };
    Settings s = Settings.getInstance(view.getContext());
    Theme theme = s.getThemeInstance(view.getContext());
    int textColor = theme.getTextColorSecondary(view.getContext());
    ImageButton minus = view.findViewById(R.id.minus);
    minus.setOnClickListener(clickListener);
    minus.setColorFilter(textColor);
    ImageButton plus = view.findViewById(R.id.plus);
    plus.setOnClickListener(clickListener);
    plus.setColorFilter(textColor);
}
Also used : ImageButton(android.widget.ImageButton) Theme(us.koller.cameraroll.themes.Theme) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) Settings(us.koller.cameraroll.data.Settings)

Example 3 with Theme

use of us.koller.cameraroll.themes.Theme in project Camera-Roll-Android-App by kollerlukas.

the class Style method getAccentColor.

int getAccentColor(Context context) {
    Settings settings = Settings.getInstance(context);
    Theme theme = settings.getThemeInstance(context);
    return theme.getAccentColor(context);
}
Also used : Theme(us.koller.cameraroll.themes.Theme) Settings(us.koller.cameraroll.data.Settings)

Example 4 with Theme

use of us.koller.cameraroll.themes.Theme in project Camera-Roll-Android-App by kollerlukas.

the class Util method tintDrawableWithAccentColor.

private static Drawable tintDrawableWithAccentColor(Context context, Drawable d) {
    Settings s = Settings.getInstance(context);
    Theme theme = s.getThemeInstance(context);
    int tintColor = theme.getAccentColorLight(context);
    d = DrawableCompat.wrap(d);
    DrawableCompat.setTint(d, tintColor);
    return d;
}
Also used : Theme(us.koller.cameraroll.themes.Theme) Settings(us.koller.cameraroll.data.Settings)

Example 5 with Theme

use of us.koller.cameraroll.themes.Theme in project Camera-Roll-Android-App by kollerlukas.

the class FileHolder method setSelected.

public void setSelected(boolean selected) {
    Context context = itemView.getContext();
    Settings s = Settings.getInstance(itemView.getContext());
    Theme theme = s.getThemeInstance(context);
    int color = selected ? theme.getAccentColor(context) : ContextCompat.getColor(context, android.R.color.transparent);
    itemView.setBackgroundColor(color);
    TextView textView = itemView.findViewById(R.id.text);
    textView.setTextColor(selected ? theme.getAccentTextColor(context) : theme.getTextColorPrimary(context));
    ImageView folderIndicator = itemView.findViewById(R.id.folder_indicator);
    folderIndicator.setColorFilter(selected ? theme.getAccentTextColor(context) : theme.getTextColorSecondary(context), PorterDuff.Mode.SRC_IN);
}
Also used : Context(android.content.Context) Theme(us.koller.cameraroll.themes.Theme) TextView(android.widget.TextView) ImageView(android.widget.ImageView) Settings(us.koller.cameraroll.data.Settings)

Aggregations

Theme (us.koller.cameraroll.themes.Theme)6 Settings (us.koller.cameraroll.data.Settings)4 TextView (android.widget.TextView)3 Context (android.content.Context)2 NonNull (android.support.annotation.NonNull)2 RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 ImageButton (android.widget.ImageButton)2 SuppressLint (android.annotation.SuppressLint)1 AlertDialog (android.support.v7.app.AlertDialog)1 ImageView (android.widget.ImageView)1 NestedRecyclerViewAlbumHolder (us.koller.cameraroll.adapter.main.viewHolder.NestedRecyclerViewAlbumHolder)1