use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillSeeStraight.
private void fillSeeStraight() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> hazeBusterRepresentations = filtersManager.getSeeStraight();
if (mCategorySeeStraightAdapter != null) {
mCategorySeeStraightAdapter.clear();
}
mCategorySeeStraightAdapter = new CategoryAdapter(this);
for (FilterRepresentation representation : hazeBusterRepresentations) {
if (representation.getTextId() != 0) {
representation.setName(getString(representation.getTextId()));
}
mCategorySeeStraightAdapter.add(new Action(this, representation));
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillBorders.
private void fillBorders() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> borders = filtersManager.getBorders();
mCategoryBordersAdapter = new CategoryAdapter(this);
for (int i = 0; i < borders.size(); i++) {
FilterRepresentation filter = borders.get(i);
filter.setName(getString(R.string.frame, i));
if (i == 0) {
filter.setName(getString(R.string.none));
}
mCategoryBordersAdapter.add(new Action(this, filter, Action.FULL_VIEW));
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillPresetFilter.
private void fillPresetFilter() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getFilterPreset();
if (mChangeable) {
ArrayList<FilterRepresentation> mFilterPreset = new ArrayList<FilterRepresentation>();
ArrayList<SaveOption> ret = mFilterPresetSource.getAllUserPresets();
if (ret == null)
return;
for (int id = 0; id < ret.size(); id++) {
FilterPresetRepresentation representation = new FilterPresetRepresentation(ret.get(id).name, ret.get(id)._id, id + 1);
Uri filteredUri = Uri.parse(ret.get(id).Uri);
representation.setUri(filteredUri);
representation.setSerializationName("Custom");
mFilterPreset.add(representation);
}
if (tempFilterArray.size() != 0) {
for (int id = 0; id < tempFilterArray.size(); id++) {
FilterPresetRepresentation representation = new FilterPresetRepresentation(tempFilterArray.get(id).name, tempFilterArray.get(id)._id, id + 1);
Uri filteredUri = Uri.parse(tempFilterArray.get(id).Uri);
representation.setUri(filteredUri);
representation.setSerializationName("Custom");
mFilterPreset.add(representation);
}
}
filtersRepresentations = mFilterPreset;
mChangeable = false;
}
if (filtersRepresentations == null)
return;
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW, true));
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class UserPresetsAdapter method updateActionFromEditText.
private void updateActionFromEditText(EditText editText) {
Action action = (Action) editText.getTag();
String newName = editText.getText().toString();
if (newName.length() > 0) {
action.setName(editText.getText().toString());
changePreset(action);
}
}
use of com.android.gallery3d.filtershow.category.Action in project android_packages_apps_Gallery2 by LineageOS.
the class UserPresetsAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
UserPresetViewHolder viewHolder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.filtershow_presets_management_row, null);
viewHolder = new UserPresetViewHolder();
viewHolder.imageView = (ImageView) convertView.findViewById(R.id.imageView);
viewHolder.editText = (EditText) convertView.findViewById(R.id.editView);
viewHolder.deleteButton = (ImageButton) convertView.findViewById(R.id.deleteUserPreset);
viewHolder.editText.setOnClickListener(this);
viewHolder.editText.setOnFocusChangeListener(this);
viewHolder.deleteButton.setOnClickListener(this);
convertView.setTag(viewHolder);
} else {
viewHolder = (UserPresetViewHolder) convertView.getTag();
}
Action action = getItem(position);
viewHolder.imageView.setImageBitmap(action.getImage());
if (action.getImage() == null) {
// queue image rendering for this action
action.setImageFrame(new Rect(0, 0, mIconSize, mIconSize), CategoryView.VERTICAL);
}
viewHolder.deleteButton.setTag(action);
viewHolder.editText.setTag(action);
viewHolder.editText.setHint(action.getName());
return convertView;
}
Aggregations