aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/camilstaps/common/Sharable.java
blob: 6e9fc56a9115529a3128fbe179948983c2829fca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.camilstaps.common;

/**
 * An item that can be shared (typically a fragment)
 */
public interface Sharable<T> {

    /**
     * Get the item that should be shared when the user clicks on element R.id.<id>
     * @param id the XML id the resource is linked to
     * @return the item to share
     */
    public abstract T getItem(int id);

    /**
     * Get the XML id of the menu to inflate to give the user different sharing options
     * @return -1 if there are no options, an XML id if there are
     */
    public abstract int getMenuId();

}