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