1
說明我需要從一類從不同的封裝改性劑的方法如何擴展和改性劑在不同的封裝的java類 - 內
封裝結構
AndroidApp ---
-- dependencies " materialSheetFab"
materialSheetFab ---
-- src
...
--MaterialSheetAnimation.class
---MaterialSheetFab
下materialSheetAnimation
,我需要在此改變
public void alignSheetWithFab(View fab) {
....
if (rightDiff != 0) { // need to remove this block of code
.....
}
的方法被稱爲在MaterialSheetFab
protected void morphIntoSheet(final AnimationListener endListener) {
// Align sheet's position with FAB
sheetAnimation.alignSheetWithFab(fab);
的問題是在materialsheetAnimation
成員變量的私人所以
public class Sample extend MaterialSheetAnimat{
......
@overide
public void AlignSheetWithFab(Fab){
....
//remove code
// but cant call any instance variable there all private
// sheet is private member // sheet.setX(fab.coord[0]; not possible
甚至延伸的類犯規允許我重寫了我所在的代碼塊