bb137c8e2ed363e6f5e2c0f14719483d27e8c062 |
|
05-Jun-2014 |
Mathew Inwood <mathewi@google.com> |
Move all logic from activity into controller. Get rid of ControllerCallbacks, and instead create a thin wrapper around Activity exposing the functionality required from the activity. Do the same for ActionBar to take care of android.support.v7.app.ActionBar and android.app.ActionBar (which have an identical interface). This eliminates a lot of duplicate code between the appcompat activity and the other activity. The only duplicated code is not boring wrapper code. To customize the activity now, subclass PhotoViewController and implement customizations in there. Then subclass the Activity and override createController to instantiate your controller subclass. Also allow subclassing of PhotoViewFragment. This is to enable the fragment to replace the logic of getting the controller from the activity, in the instance that the activity does not implement ActivityInterface directly itself. Bug: 15090270 Change-Id: Ib31ae155b5afabff848624b0721d6eaf96312c12
/frameworks/opt/photoviewer/src/com/android/ex/photo/ActionBarInterface.java
|