Cancel Done buttons in Calendar App - Is it part of Action Bar?

前端 未结 3 850
Happy的楠姐
Happy的楠姐 2020-12-14 23:17

\"Google

Hi, I\'m refering the Cancel/Done button in Calendar app. These 2 buttons are pinned on

3条回答
  •  温柔的废话
    2020-12-14 23:53

    Remember that Android is open source, and most apps preinstalled on an android device running aosp are open source.

    Here's the project: https://github.com/android/platform_packages_apps_calendar

    Yes, it is a custom ActionBar setup, here's the XML:

    
    
    
    
    
    
        
    
    
    
    
    
    
        
        
    
        
    

    That is later set on runtime:

    View actionBarButtons = inflater.inflate(R.layout.edit_event_custom_actionbar,
    new LinearLayout(mContext), false);
    View cancelActionView = actionBarButtons.findViewById(R.id.action_cancel);
    cancelActionView.setOnClickListener(mActionBarListener);
    View doneActionView = actionBarButtons.findViewById(R.id.action_done);
    doneActionView.setOnClickListener(mActionBarListener);
    mContext.getActionBar().setCustomView(actionBarButtons);
    

    Hope that helped

提交回复
热议问题