/* * Copyright (C) 2008 ZXing authors * * 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. */ package org.ovirt.mobile.movirt.camera; import android.app.Activity; import android.os.Bundle; import org.androidannotations.annotations.EActivity; import org.androidannotations.annotations.Receiver; import org.ovirt.mobile.movirt.Broadcasts; import org.ovirt.mobile.movirt.util.message.CreateDialogBroadcastReceiver; import org.ovirt.mobile.movirt.util.message.CreateDialogBroadcastReceiverHelper; /** * The main settings activity. * * @author dswitkin@google.com (Daniel Switkin) * @author Sean Owen * modified by Nika */ @EActivity public class PreferencesActivity extends Activity implements CreateDialogBroadcastReceiver { public static final String KEY_PLAY_BEEP = "preferences_play_beep"; public static final String KEY_VIBRATE = "preferences_vibrate"; public static final String KEY_FRONT_LIGHT_MODE = "preferences_front_light_mode"; public static final String KEY_AUTO_FOCUS = "preferences_auto_focus"; public static final String KEY_INVERT_SCAN = "preferences_invert_scan"; public static final String KEY_DISABLE_CONTINUOUS_FOCUS = "preferences_disable_continuous_focus"; public static final String KEY_DISABLE_EXPOSURE = "preferences_disable_exposure"; public static final String KEY_DISABLE_METERING = "preferences_disable_metering"; public static final String KEY_DISABLE_BARCODE_SCENE_MODE = "preferences_disable_barcode_scene_mode"; @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); getFragmentManager().beginTransaction().replace(android.R.id.content, new PreferencesFragment()).commit(); } @Receiver(actions = {Broadcasts.ERROR_MESSAGE}, registerAt = Receiver.RegisterAt.OnResumeOnPause) public void showErrorDialog( @Receiver.Extra(Broadcasts.Extras.ERROR_REASON) String reason, @Receiver.Extra(Broadcasts.Extras.REPEATED_MINOR_ERROR) boolean repeatedMinorError) { CreateDialogBroadcastReceiverHelper.showErrorDialog(getFragmentManager(), reason, repeatedMinorError); } @Receiver(actions = {Broadcasts.REST_CA_FAILURE}, registerAt = Receiver.RegisterAt.OnResumeOnPause) public void showCertificateDialog( @Receiver.Extra(Broadcasts.Extras.ERROR_REASON) String reason) { CreateDialogBroadcastReceiverHelper.showCertificateDialog(getFragmentManager(), reason, true); } }