summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/photoeditor/EffectsBar.java
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2011-12-03 03:23:52 +0800
committerYuli Huang <yuli@google.com>2011-12-05 11:15:45 +0800
commit26c0354619d6229a937f4232e2c9744385c046ad (patch)
treeb9223ee749578154e46e1a9776c486bb87750f89 /src/com/android/gallery3d/photoeditor/EffectsBar.java
parent5a3b6e0954b19142f4f4de09ce9f7e38052f283c (diff)
downloadandroid_packages_apps_Gallery2-26c0354619d6229a937f4232e2c9744385c046ad.tar.gz
android_packages_apps_Gallery2-26c0354619d6229a937f4232e2c9744385c046ad.tar.bz2
android_packages_apps_Gallery2-26c0354619d6229a937f4232e2c9744385c046ad.zip
Fix effect-label layout and a TODO.
1. Seekbar was wrongly placed below effect label because of the added order. 2. Fix a TODO by refactoring EffectToolFactory to EffectToolKit. Change-Id: I8d37c2c2b6d15f2af65d4e6b27116afe01df63c9
Diffstat (limited to 'src/com/android/gallery3d/photoeditor/EffectsBar.java')
-rw-r--r--src/com/android/gallery3d/photoeditor/EffectsBar.java17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/com/android/gallery3d/photoeditor/EffectsBar.java b/src/com/android/gallery3d/photoeditor/EffectsBar.java
index 0fd6b758c..de47159a3 100644
--- a/src/com/android/gallery3d/photoeditor/EffectsBar.java
+++ b/src/com/android/gallery3d/photoeditor/EffectsBar.java
@@ -22,11 +22,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-import android.widget.TextView;
import com.android.gallery3d.R;
import com.android.gallery3d.photoeditor.actions.EffectAction;
-import com.android.gallery3d.photoeditor.actions.EffectToolFactory;
/**
* Effects bar that contains all effects and shows them in categorized views.
@@ -37,7 +35,6 @@ public class EffectsBar extends LinearLayout {
private FilterStack filterStack;
private EffectsMenu effectsMenu;
private View effectsGallery;
- private ViewGroup effectToolPanel;
private EffectAction activeEffect;
public EffectsBar(Context context, AttributeSet attrs) {
@@ -91,9 +88,6 @@ public class EffectsBar extends LinearLayout {
// Set the clicked effect active before exiting effects-gallery.
activeEffect = effect;
exitEffectsGallery();
- // Create effect tool panel first before the factory could create tools within.
- // TODO: Refactor to encapsulate effect-tool panel in effect-tool factory.
- createEffectToolPanel();
EffectAction.ActionListener listener = new EffectAction.ActionListener() {
@Override
@@ -101,20 +95,12 @@ public class EffectsBar extends LinearLayout {
exit(null);
}
};
- activeEffect.begin(filterStack, new EffectToolFactory(
- effectToolPanel, inflater), listener);
+ activeEffect.begin(getRootView(), filterStack, listener);
}
}
});
}
- private void createEffectToolPanel() {
- effectToolPanel = (ViewGroup) inflater.inflate(
- R.layout.photoeditor_effect_tool_panel, this, false);
- ((TextView) effectToolPanel.findViewById(R.id.effect_label)).setText(activeEffect.name());
- addView(effectToolPanel, 0);
- }
-
private boolean exitEffectsGallery() {
if (effectsGallery != null) {
if (activeEffect != null) {
@@ -136,7 +122,6 @@ public class EffectsBar extends LinearLayout {
@Override
public void run() {
SpinnerProgressDialog.dismissDialog();
- effectToolPanel = null;
activeEffect = null;
if (runnableOnDone != null) {
runnableOnDone.run();