-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Implement #3175: Add home screen folder/file shortcut widget #5522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6a3be12
3175: initial commit for home screen shortcuts
wiwie fb1eed2
3175: creating pinned shortcuts without using dynamic shortcuts to av…
wiwie fb99107
3175: using Intent.FLAG_ACTIVITY_CLEAR_TOP
wiwie 975c337
Merge pull request #1 from wiwie/3175
wiwie 68c600d
#3175: added resource string
wiwie e5cf5f9
Merge branch '3175'
wiwie a3b3a9d
3175: only creating icon if pinning is supported
wiwie 9e3e833
3175: terminology fix; desktop -> homescreen
wiwie 2193572
3175: only invoking executePendingTransactions() when it is necessary
wiwie 48fe28f
3175: added javadoc
wiwie 5c5f4df
3175: using thumbnails of files as icons for pinned shortcuts
wiwie b454476
3175: optimized imports
wiwie eefda1e
3175: hide menu items if pinned shortcuts not available
wiwie 5b66eca
3175: making MenuHelper utility class
wiwie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/androidTest/java/com/owncloud/android/ui/helpers/FileOperationsHelperTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package com.owncloud.android.ui.helpers; | ||
|
|
||
| public class FileOperationsHelperTest { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/owncloud/android/ui/helpers/MenuHelper.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.owncloud.android.ui.helpers; | ||
|
|
||
| import android.os.Build; | ||
| import android.view.Menu; | ||
| import android.view.MenuInflater; | ||
|
|
||
| import com.owncloud.android.R; | ||
|
|
||
| /** | ||
| * Collection of helper functions for handling menus. | ||
| */ | ||
| public final class MenuHelper { | ||
|
|
||
| private MenuHelper() { | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * Inflates the item file menu and handles menu items according to SDK version. | ||
| * | ||
| * @param inflater The inflater to use for inflation of the item file menu. | ||
| * @param menu The menu into which to inflate. | ||
| */ | ||
| public static void inflateItemFileMenu(final MenuInflater inflater, final Menu menu) { | ||
| inflater.inflate(R.menu.item_file, menu); | ||
| menu.findItem(R.id.action_add_shortcut_to_homescreen).setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't say for sure if it will be the right place, but you might want to check if this needs to be moved/added to
FileMenuFilter, while this might not work since (unfortunately)FileMenuFilterisn't used in all places whereR.menu.item_fileis being used while your implementation (correctly) is.So also looping in @tobiasKaminsky @ezaquarii for further discussion