#java
#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
даже расширение класса не позволяет мне переписать интересующий меня блок кода
Ответ №1:
Но проблема в том, что переменная-член в materialsheetAnimation является частной, поэтому даже расширение класса не позволяет мне переписать интересующий меня блок кода
Это определение private
члена, вы не можете его переопределить.