How to add copyright to Android-Studio?

前端 未结 6 1420
既然无缘
既然无缘 2021-02-01 01:13

The title says everything. If I want to add copyright comment in code files in Android Studio? I, of course, find the Copyright settings in Preference/Copyright, but I can\'t ma

相关标签:
6条回答
  • 2021-02-01 01:43

    You can find file header in Preference menu.

    Android Studio - Preference - File and Code Templates

    Select includes Tab. You can edit file header.

    0 讨论(0)
  • 2021-02-01 01:51

    On the file you want to insert the copyright notice you have to press Alt+Insert for Windows and GNU/Linux or Command+N for Mac and select the copyright to be inserted.

    http://www.jetbrains.com/idea/webhelp/generating-and-updating-copyright-notice.html

    0 讨论(0)
  • 2021-02-01 01:51

    File > Settings > Editor > Copyright > Copyright Profiles > + add -> profile name

    Sample Copyright Template Text

    /**
     * Created by Karthik Kompelli on $today
     * Copyright (c) $today.year . All rights reserved.
     * Last modified $file.lastModified
     */
    

    If you need any extra variables, please visit source Copyright Profiles

    0 讨论(0)
  • 2021-02-01 01:51

    You need to first create a copyright profile (Settings | Copyright | Copyright profiles), then go to Settings | Copyright and change the default copyright.

    0 讨论(0)
  • 2021-02-01 01:55

    Go to Settings> Copyright> Copyright Profiles. Create one copyright profile. Then go to Settings | Copyright and change the default copyright to the one which you created and Apply>Ok.

    And from the top menu Click Code -> click Update copy right and select the files you want to apply.

    0 讨论(0)
  • 2021-02-01 02:03

    After you have configured the copyright settings and copyright profiles (Settings > Editor > Copyright) for your project, you can:

    • (Windows) Use Alt + Insert in an opened file to present the option for adding/updating the copyright
    • (Mac) Use Command + N in an opened file to present the option for adding/updating the copyright
    • Right click a directory or file in Android Studio's project view, and select "Update Copyright..."
    0 讨论(0)
提交回复
热议问题