use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method fillLooks.
private void fillLooks() {
FiltersManager filtersManager = FiltersManager.getManager();
ArrayList<FilterRepresentation> filtersRepresentations = filtersManager.getLooks();
if (mCategoryLooksAdapter != null) {
mCategoryLooksAdapter.clear();
}
mCategoryLooksAdapter = new CategoryAdapter(this);
int verticalItemHeight = (int) getResources().getDimension(R.dimen.action_item_height);
mCategoryLooksAdapter.setItemHeight(verticalItemHeight);
for (FilterRepresentation representation : filtersRepresentations) {
mCategoryLooksAdapter.add(new Action(this, representation, Action.FULL_VIEW));
}
if (FilterGeneratorNativeEngine.getInstance().isLibLoaded()) {
if (mUserPresetsManager.getRepresentations() == null || mUserPresetsManager.getRepresentations().size() == 0) {
mCategoryLooksAdapter.add(new Action(this, Action.ADD_ACTION));
}
}
fillPresetFilter();
Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel != null) {
if (panel instanceof MainPanel) {
MainPanel mainPanel = (MainPanel) panel;
mainPanel.loadCategoryLookPanel(true);
}
}
}
use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method toggleVersionsPanel.
public void toggleVersionsPanel() {
mShowingVersionsPanel = !mShowingVersionsPanel;
Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel != null && panel instanceof MainPanel) {
MainPanel mainPanel = (MainPanel) panel;
mainPanel.loadCategoryVersionsPanel();
}
}
use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method toggleImageStatePanel.
// //////////////////////////////////////////////////////////////////////////////
// imageState panel...
public void toggleImageStatePanel() {
invalidateOptionsMenu();
mShowingImageStatePanel = !mShowingImageStatePanel;
Fragment panel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel != null) {
if (panel instanceof EditorPanel) {
EditorPanel editorPanel = (EditorPanel) panel;
editorPanel.showImageStatePanel(mShowingImageStatePanel);
} else if (panel instanceof MainPanel) {
MainPanel mainPanel = (MainPanel) panel;
mainPanel.showImageStatePanel(mShowingImageStatePanel);
}
}
}
use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.
the class FilterShowActivity method loadMainPanel.
public void loadMainPanel() {
if (findViewById(R.id.main_panel_container) == null) {
return;
}
MainPanel panel = new MainPanel();
Bundle bundle = new Bundle();
bundle.putBoolean(MainPanel.EDITOR_TAG, isComingFromEditorScreen);
panel.setArguments(bundle);
isComingFromEditorScreen = false;
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_panel_container, panel, MainPanel.FRAGMENT_TAG);
transaction.commitAllowingStateLoss();
}
use of com.android.gallery3d.filtershow.category.MainPanel in project android_packages_apps_Gallery2 by LineageOS.
the class EditorPanel method showImageStatePanel.
public void showImageStatePanel(boolean show) {
View container = mMainView.findViewById(R.id.state_panel_container);
FragmentTransaction transaction = null;
boolean child = false;
if (container == null) {
FilterShowActivity activity = (FilterShowActivity) getActivity();
container = activity.getMainStatePanelContainer(R.id.state_panel_container);
} else {
transaction = getChildFragmentManager().beginTransaction();
child = true;
}
if (container == null) {
return;
} else {
transaction = getFragmentManager().beginTransaction();
}
Fragment panel = getActivity().getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (panel == null || panel instanceof MainPanel) {
transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
}
if (show) {
container.setVisibility(View.VISIBLE);
StatePanel statePanel = new StatePanel();
transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG);
} else {
Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
if (child) {
statePanel = getFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
}
if (statePanel != null) {
transaction.remove(statePanel);
}
}
transaction.commit();
}
Aggregations