
it.tidalwave.bluebill.mobile.android.taxonomy.factsheet.commonnames.TaxonCommonNamesFactSheetActivity Maven / Gradle / Ivy
The newest version!
/***********************************************************************************************************************
*
* blueBill Mobile - Android - open source birding
* Copyright (C) 2009-2011 by Tidalwave s.a.s. (http://www.tidalwave.it)
*
***********************************************************************************************************************
*
* 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.
*
***********************************************************************************************************************
*
* WWW: http://bluebill.tidalwave.it/mobile
* SCM: https://java.net/hg/bluebill-mobile~android-src
*
**********************************************************************************************************************/
package it.tidalwave.bluebill.mobile.android.taxonomy.factsheet.commonnames;
import javax.annotation.Nonnull;
import it.tidalwave.role.ui.PresentationModel;
import it.tidalwave.bluebill.mobile.taxonomy.factsheet.ui.commonnames.TaxonCommonNamesFactSheetFlowController;
import android.content.Intent;
import it.tidalwave.bluebill.mobile.android.R;
import it.tidalwave.bluebill.mobile.android.taxonomy.factsheet.TaxonFactSheetActivitySupport;
import lombok.extern.slf4j.Slf4j;
import static it.tidalwave.role.ui.android.IntentProvider.IntentProvider;
/***********************************************************************************************************************
*
* @stereotype Activity
*
* @author Fabrizio Giudici
* @version $Id$
*
**********************************************************************************************************************/
@Slf4j
public class TaxonCommonNamesFactSheetActivity extends TaxonFactSheetActivitySupport
{
private final TaxonCommonNamesFactSheetFlowController flowController = new TaxonCommonNamesFactSheetFlowController()
{
public void showCommonNameInFullScreen (final @Nonnull PresentationModel commonNamesPM)
{
log.info("showCommonNameInFullScreen({})", commonNamesPM);
final Intent intent = commonNamesPM.as(IntentProvider).createIntent(getBaseContext(), TaxonLargeCommonNameFactSheetActivity.class);
startActivity(intent);
}
};
public TaxonCommonNamesFactSheetActivity()
{
super(R.layout.view_taxon_fact_sheet_common_names, R.id.viewTaxonFactSheetCommonNames);
}
@Override
protected void initializeView()
{
// FIXME: it's very tricky how we set it!
// TODO: the problem is that it's the View responsibility to create its controller. It's wrong.
// Introduce a initialize(Controller) method in views and let each Activity to assign the proper controller.
// So controllers are created by Activities.
((AndroidTaxonCommonNamesFactSheetView)view).setFlowController(flowController);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy