如何在不同的java包中扩展和修改类——内部解释
我需要修改来自不同包的类中的方法 包结构 安德洛伊达普-- 材料表选项卡--- 在如何在不同的java包中扩展和修改类——内部解释,java,Java,我需要修改来自不同包的类中的方法 包结构 安德洛伊达普-- 材料表选项卡--- 在材质表激活下,我需要跳过 public void alignSheetWithFab(View fab) { .... if (rightDiff != 0) { // need to remove this block of code ..... } 该方法在MaterialSheetFab protected void morphIntoSheet(final An
材质表激活下
,我需要跳过
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);
问题在于材质表中的成员变量是私有的,因此
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
即使扩展类也不允许我重写所插入的代码块
B但问题是materialsheetAnimation中的成员变量是私有的,因此即使扩展类也不允许我重写所插入的代码块
这是private
成员的定义,您不能覆盖它
B但问题是materialsheetAnimation中的成员变量是私有的,因此即使扩展类也不允许我重写所插入的代码块
这是private
成员的定义,您不能覆盖它
protected void morphIntoSheet(final AnimationListener endListener) {
// Align sheet's position with FAB
sheetAnimation.alignSheetWithFab(fab);
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