--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:gravity="center_horizontal|center_vertical"
+ android:padding="10dip">
+
+<ProgressBar android:id="@+id/progress_bar"
+ android:layout_alignParentRight="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:visibility="visible"
+ android:paddingBottom="144dp" />
+
+</LinearLayout>
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
+import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.Rect;
import android.widget.FrameLayout;
import android.widget.ShareActionProvider;
import android.widget.ShareActionProvider.OnShareTargetSelectedListener;
+import android.widget.Spinner;
import android.widget.Toast;
import com.android.gallery3d.R;
private ProcessingService mBoundService;
private boolean mIsBound = false;
+ private Menu mMenu;
public ProcessingService getProcessingService() {
return mBoundService;
}
}
- private void setupPipeline() {
- doBindService();
+ public void updateUIAfterServiceStarted() {
+ MasterImage.setMaster(mMasterImage);
ImageFilter.setActivityForMemoryToasts(this);
mUserPresetsManager = new UserPresetsManager(this);
mUserPresetsAdapter = new UserPresetsAdapter(this);
- }
- public void updateUIAfterServiceStarted() {
+ setupMasterImage();
+ setupMenu();
+ setDefaultValues();
+ fillEditors();
+ getWindow().setBackgroundDrawable(new ColorDrawable(0));
+ loadXML();
+
fillCategories();
loadMainPanel();
extractXMPData();
if (onlyUsePortrait) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
- MasterImage.setMaster(mMasterImage);
clearGalleryBitmapPool();
- setupPipeline();
-
- setupMasterImage();
- setDefaultValues();
- fillEditors();
-
- loadXML();
+ doBindService();
+ getWindow().setBackgroundDrawable(new ColorDrawable(Color.GRAY));
+ setContentView(R.layout.filtershow_splashscreen);
UsageStatistics.onContentViewChanged(UsageStatistics.COMPONENT_EDITOR, "Main");
UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
UsageStatistics.CATEGORY_LIFECYCLE, UsageStatistics.LIFECYCLE_START);
int curveHandleSize = (int) res.getDimension(R.dimen.crop_indicator_size);
Spline.setCurveHandle(curveHandle, curveHandleSize);
Spline.setCurveWidth((int) getPixelsFromDip(3));
+
+ mOriginalImageUri = null;
}
private void startLoadBitmap(Uri uri) {
}
if (!result) {
- if (!mOriginalImageUri.equals(mSelectedImageUri)) {
+ if (mOriginalImageUri != null
+ && !mOriginalImageUri.equals(mSelectedImageUri)) {
mOriginalImageUri = mSelectedImageUri;
mOriginalPreset = null;
Toast.makeText(FilterShowActivity.this,
.getActionProvider();
mShareActionProvider.setShareIntent(getDefaultShareIntent());
mShareActionProvider.setOnShareTargetSelectedListener(this);
+ mMenu = menu;
+ return true;
+ }
- MenuItem undoItem = menu.findItem(R.id.undoButton);
- MenuItem redoItem = menu.findItem(R.id.redoButton);
- MenuItem resetItem = menu.findItem(R.id.resetHistoryButton);
+ private void setupMenu(){
+ MenuItem undoItem = mMenu.findItem(R.id.undoButton);
+ MenuItem redoItem = mMenu.findItem(R.id.redoButton);
+ MenuItem resetItem = mMenu.findItem(R.id.resetHistoryButton);
mMasterImage.getHistory().setMenuItems(undoItem, redoItem, resetItem);
- return true;
}
@Override