Java Code Examples for org.telegram.tgnet.TLRPC#WebPage

The following examples show how to use org.telegram.tgnet.TLRPC#WebPage . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileRefController.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private byte[] getFileReference(TLRPC.WebPage webpage, TLRPC.InputFileLocation location, boolean[] needReplacement, TLRPC.InputFileLocation[] replacement) {
    byte[] result = getFileReference(webpage.document, location, needReplacement, replacement);
    if (result != null) {
        return result;
    }
    result = getFileReference(webpage.photo, location, needReplacement, replacement);
    if (result != null) {
        return result;
    }
    if (!webpage.attributes.isEmpty()) {
        for (int a = 0, size1 = webpage.attributes.size(); a < size1; a++) {
            TLRPC.TL_webPageAttributeTheme attribute = webpage.attributes.get(a);
            for (int b = 0, size2 = attribute.documents.size(); b < size2; b++) {
                result = getFileReference(attribute.documents.get(b), location, needReplacement, replacement);
                if (result != null) {
                    return result;
                }
            }
        }
    }
    if (webpage.cached_page != null) {
        for (int b = 0, size2 = webpage.cached_page.documents.size(); b < size2; b++) {
            result = getFileReference(webpage.cached_page.documents.get(b), location, needReplacement, replacement);
            if (result != null) {
                return result;
            }
        }
        for (int b = 0, size2 = webpage.cached_page.photos.size(); b < size2; b++) {
            result = getFileReference(webpage.cached_page.photos.get(b), location, needReplacement, replacement);
            if (result != null) {
                return result;
            }
        }
    }
    return null;
}
 
Example 2
Source File: FileRefController.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private byte[] getFileReference(TLRPC.WebPage webpage, TLRPC.InputFileLocation location, boolean[] needReplacement, TLRPC.InputFileLocation[] replacement) {
    byte[] result = getFileReference(webpage.document, location, needReplacement, replacement);
    if (result != null) {
        return result;
    }
    result = getFileReference(webpage.photo, location, needReplacement, replacement);
    if (result != null) {
        return result;
    }
    if (!webpage.attributes.isEmpty()) {
        for (int a = 0, size1 = webpage.attributes.size(); a < size1; a++) {
            TLRPC.TL_webPageAttributeTheme attribute = webpage.attributes.get(a);
            for (int b = 0, size2 = attribute.documents.size(); b < size2; b++) {
                result = getFileReference(attribute.documents.get(b), location, needReplacement, replacement);
                if (result != null) {
                    return result;
                }
            }
        }
    }
    if (webpage.cached_page != null) {
        for (int b = 0, size2 = webpage.cached_page.documents.size(); b < size2; b++) {
            result = getFileReference(webpage.cached_page.documents.get(b), location, needReplacement, replacement);
            if (result != null) {
                return result;
            }
        }
        for (int b = 0, size2 = webpage.cached_page.photos.size(); b < size2; b++) {
            result = getFileReference(webpage.cached_page.photos.get(b), location, needReplacement, replacement);
            if (result != null) {
                return result;
            }
        }
    }
    return null;
}
 
Example 3
Source File: MediaActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private void openWebView(TLRPC.WebPage webPage) {
    EmbedBottomSheet.show(getParentActivity(), webPage.site_name, webPage.description, webPage.url, webPage.embed_url, webPage.embed_width, webPage.embed_height);
}
 
Example 4
Source File: MediaActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void needOpenWebView(TLRPC.WebPage webPage) {
    MediaActivity.this.openWebView(webPage);
}
 
Example 5
Source File: ChatActivityEnterView.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void setWebPage(TLRPC.WebPage webPage, boolean searchWebPages)
{
    messageWebPage = webPage;
    messageWebPageSearch = searchWebPages;
}
 
Example 6
Source File: MediaActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private void openWebView(TLRPC.WebPage webPage) {
    EmbedBottomSheet.show(getParentActivity(), webPage.site_name, webPage.description, webPage.url, webPage.embed_url, webPage.embed_width, webPage.embed_height);
}
 
Example 7
Source File: MediaActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void needOpenWebView(TLRPC.WebPage webPage) {
    MediaActivity.this.openWebView(webPage);
}
 
Example 8
Source File: ChatActivityEnterView.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void setWebPage(TLRPC.WebPage webPage, boolean searchWebPages)
{
    messageWebPage = webPage;
    messageWebPageSearch = searchWebPages;
}
 
Example 9
Source File: MediaActivity.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
private void openWebView(TLRPC.WebPage webPage) {
    EmbedBottomSheet.show(getParentActivity(), webPage.site_name, webPage.description, webPage.url, webPage.embed_url, webPage.embed_width, webPage.embed_height);
}
 
Example 10
Source File: MediaActivity.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void needOpenWebView(TLRPC.WebPage webPage) {
    MediaActivity.this.openWebView(webPage);
}
 
Example 11
Source File: MediaActivity.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
private void openWebView(TLRPC.WebPage webPage) {
    EmbedBottomSheet.show(getParentActivity(), webPage.site_name, webPage.description, webPage.url, webPage.embed_url, webPage.embed_width, webPage.embed_height);
}
 
Example 12
Source File: MediaActivity.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void needOpenWebView(TLRPC.WebPage webPage) {
    MediaActivity.this.openWebView(webPage);
}
 
Example 13
Source File: SharedLinkCell.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void needOpenWebView(TLRPC.WebPage webPage); 
Example 14
Source File: SharedLinkCell.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void needOpenWebView(TLRPC.WebPage webPage); 
Example 15
Source File: SharedLinkCell.java    From Telegram-FOSS with GNU General Public License v2.0 votes vote down vote up
void needOpenWebView(TLRPC.WebPage webPage); 
Example 16
Source File: SharedLinkCell.java    From Telegram with GNU General Public License v2.0 votes vote down vote up
void needOpenWebView(TLRPC.WebPage webPage);