<commit_before>/**
 * Copyright (c) 2013-2014 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

import QtQuick 2.0
import Sailfish.Silica 1.0

import "../utils"
import "../components"

Item {
    id: itemcontainer

    property int idx: index
    property string channelId: id
    property bool down: channelItem.pressed && channelItem.containsMouse

    property bool _hasContextMenu: gridView.contextMenu && gridView.contextMenu.parent === itemcontainer

    width: gridView.cellWidth
    height: _hasContextMenu
            ? gridView.cellHeight + gridView.contextMenu.height
            : gridView.cellHeight

    opacity: !_hasContextMenu && gridView.contextMenuActive ? 0.2 : 1

    BackgroundItem {
        id: channelItem

        width: gridView.cellWidth
        height: gridView.cellHeight
        y: gridView.contextMenu && index >= gridView.minOffsetIndex
           ? gridView.contextMenu.height
           : 0

        highlighted: down || _hasContextMenu

        ChannelImage {
            id: channelImage
            size: BusyIndicatorSize.Medium
            width: gridView.cellWidth
            height: gridView.cellHeight
            source: imageMediumUrl
            anchors.fill: parent
        }

        onPressAndHold: gridView._showContextMenu(itemcontainer)

        onClicked: gridView._goToChannelPage(id)

        onPressed: gridView.currentIndex = index
    }
}<commit_msg>improve animation when removing a favorite (fixed as well problem when removing last favorites on second page)<commit_after>/**
 * Copyright (c) 2013-2014 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

import QtQuick 2.0
import Sailfish.Silica 1.0

import "../utils"
import "../components"

Item {
    id: itemcontainer

    property int idx: index
    property string channelId: id
    property bool down: channelItem.pressed && channelItem.containsMouse

    property bool _hasContextMenu: gridView.contextMenu && gridView.contextMenu.parent === itemcontainer

    width: gridView.cellWidth
    height: _hasContextMenu
            ? gridView.cellHeight + gridView.contextMenu.height
            : gridView.cellHeight

    opacity: !_hasContextMenu && gridView.contextMenuActive ? 0.2 : 1

    BackgroundItem {
        id: channelItem

        width: gridView.cellWidth
        height: gridView.cellHeight
        y: gridView.contextMenu && index >= gridView.minOffsetIndex
           ? gridView.contextMenu.height
           : 0

        highlighted: down || _hasContextMenu

        ChannelImage {
            id: channelImage
            size: BusyIndicatorSize.Medium
            width: gridView.cellWidth
            height: gridView.cellHeight
            source: imageMediumUrl
            anchors.fill: parent
        }

        onPressAndHold: gridView._showContextMenu(itemcontainer)

        onClicked: gridView._goToChannelPage(id)

        onPressed: gridView.currentIndex = index
    }

    GridView.onRemove: RemoveAnimation {
        target: itemcontainer
        duration: 700
    }
}
{'fraction_non_alphanumeric': 0.07511737089201878, 'fraction_numerical': 0.010954616588419406, 'mean_word_length': 2.539313399778516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3616414', 'n_tokens_mistral': 884, 'n_tokens_neox': 828, 'n_words': 234}