use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class MainPanel method setCategoryFragment.
private void setCategoryFragment(Fragment category, boolean fromRight) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
FilterShowActivity activity = (FilterShowActivity) getActivity();
if (fromRight) {
transaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_right);
} else {
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left);
}
activity.setActionBar();
transaction.replace(R.id.category_panel_container, category, CategoryPanel.FRAGMENT_TAG);
transaction.commitAllowingStateLoss();
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class MainPanel method loadCategoryHazeBusterPanel.
public void loadCategoryHazeBusterPanel() {
final FilterShowActivity activity = (FilterShowActivity) getActivity();
CategoryAdapter adapter = activity.getCategoryHazeBusterAdapter();
if (adapter.getCount() == 1) {
activity.showRepresentation(adapter.getItem(0).getRepresentation());
} else {
boolean fromRight = isRightAnimation(HAZEBUSTER);
selection(mCurrentSelected, false);
CategoryPanel categoryPanel = new CategoryPanel();
categoryPanel.setAdapter(HAZEBUSTER);
setCategoryFragment(categoryPanel, fromRight);
mCurrentSelected = HAZEBUSTER;
selection(mCurrentSelected, true);
}
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class MainPanel method selection.
private void selection(int position, boolean value) {
if (value) {
FilterShowActivity activity = (FilterShowActivity) getActivity();
activity.setCurrentPanel(position);
}
switch(position) {
case LOOKS:
{
looksButton.setSelected(value);
break;
}
case BORDERS:
{
bordersButton.setSelected(value);
break;
}
case GEOMETRY:
{
geometryButton.setSelected(value);
break;
}
case FILTERS:
{
filtersButton.setSelected(value);
break;
}
case MAKEUP:
{
if (makeupButton != null) {
makeupButton.setSelected(value);
}
break;
}
case DUALCAM:
{
dualCamButton.setSelected(value);
break;
}
case TRUEPORTRAIT:
{
truePortraitButton.setSelected(value);
break;
}
case TRUESCANNER:
{
if (trueScannerButton != null) {
trueScannerButton.setSelected(value);
}
break;
}
case HAZEBUSTER:
{
if (hazeBusterButton != null) {
hazeBusterButton.setSelected(value);
}
break;
}
case SEESTRAIGHT:
{
if (seeStraightButton != null) {
seeStraightButton.setSelected(value);
}
break;
}
case WATERMARK:
{
waterMarkButton.setSelected(value);
break;
}
}
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class MainPanel method loadCategoryTrueScannerPanel.
public void loadCategoryTrueScannerPanel() {
final FilterShowActivity activity = (FilterShowActivity) getActivity();
CategoryAdapter adapter = activity.getCategoryTrueScannerAdapter();
if (adapter.getCount() == 1) {
activity.showRepresentation(adapter.getItem(0).getRepresentation());
} else {
boolean fromRight = isRightAnimation(TRUESCANNER);
selection(mCurrentSelected, false);
CategoryPanel categoryPanel = new CategoryPanel();
categoryPanel.setAdapter(TRUESCANNER);
setCategoryFragment(categoryPanel, fromRight);
mCurrentSelected = TRUESCANNER;
selection(mCurrentSelected, true);
}
}
use of com.android.gallery3d.filtershow.FilterShowActivity in project android_packages_apps_Gallery2 by LineageOS.
the class MainPanel method showImageStatePanel.
public void showImageStatePanel(boolean show) {
View container = mMainView.findViewById(R.id.state_panel_container);
FragmentTransaction transaction = null;
if (container == null) {
FilterShowActivity activity = (FilterShowActivity) getActivity();
container = activity.getMainStatePanelContainer(R.id.state_panel_container);
} else {
transaction = getChildFragmentManager().beginTransaction();
}
if (container == null) {
return;
} else {
transaction = getFragmentManager().beginTransaction();
}
int currentPanel = mCurrentSelected;
if (show) {
container.setVisibility(View.VISIBLE);
StatePanel statePanel = new StatePanel();
statePanel.setMainPanel(this);
FilterShowActivity activity = (FilterShowActivity) getActivity();
activity.updateVersions();
transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG);
} else {
container.setVisibility(View.GONE);
Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG);
if (statePanel != null) {
transaction.remove(statePanel);
}
if (currentPanel == VERSIONS) {
currentPanel = LOOKS;
}
}
mCurrentSelected = -1;
showPanel(currentPanel);
transaction.commit();
}
Aggregations