Java Code Examples for org.telegram.ui.LocationActivity#LOCATION_TYPE_GROUP_VIEW

The following examples show how to use org.telegram.ui.LocationActivity#LOCATION_TYPE_GROUP_VIEW . 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: LocationActivityAdapter.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getItemCount() {
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP_VIEW) {
        return 2;
    } else if (locationType == LocationActivity.LOCATION_TYPE_GROUP) {
        return 2;
    } else if (currentMessageObject != null) {
        return 2 + (currentLiveLocations.isEmpty() ? 1 : currentLiveLocations.size() + 3);
    } else if (locationType == 2) {
        return 2 + currentLiveLocations.size();
    } else {
        if (searching || !searching && places.isEmpty()) {
            return (locationType != 0 ? 6 : 5) + (needEmptyView ? 1 : 0);
        }
        if (locationType == 1) {
            return 5 + places.size() + (places.isEmpty() ? 0 : 1) + (needEmptyView ? 1 : 0);
        } else {
            return 4 + places.size() + (places.isEmpty() ? 0 : 1) + (needEmptyView ? 1 : 0);
        }
    }
}
 
Example 2
Source File: LocationActivityAdapter.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int getItemCount() {
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP_VIEW) {
        return 2;
    } else if (locationType == LocationActivity.LOCATION_TYPE_GROUP) {
        return 2;
    } else if (currentMessageObject != null) {
        return 2 + (currentLiveLocations.isEmpty() ? 1 : currentLiveLocations.size() + 3);
    } else if (locationType == 2) {
        return 2 + currentLiveLocations.size();
    } else {
        if (searching || !searching && places.isEmpty()) {
            return (locationType != 0 ? 6 : 5) + (needEmptyView ? 1 : 0);
        }
        if (locationType == 1) {
            return 5 + places.size() + (places.isEmpty() ? 0 : 1) + (needEmptyView ? 1 : 0);
        } else {
            return 4 + places.size() + (places.isEmpty() ? 0 : 1) + (needEmptyView ? 1 : 0);
        }
    }
}
 
Example 3
Source File: LocationActivityAdapter.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getItemViewType(int position) {
    if (position == 0) {
        return 0;
    }
    if (needEmptyView && position == getItemCount() - 1) {
        return 10;
    }
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP_VIEW) {
        return 7;
    }
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP) {
        return 1;
    }
    if (currentMessageObject != null) {
        if (currentLiveLocations.isEmpty()) {
            if (position == 2) {
                return 8;
            }
        } else {
            if (position == 2) {
                return 9;
            } else if (position == 3) {
                return 2;
            } else if (position == 4) {
                shareLiveLocationPotistion = position;
                return 6;
            }
        }
        return 7;
    }
    if (locationType == 2) {
        if (position == 1) {
            shareLiveLocationPotistion = position;
            return 6;
        } else {
            return 7;
        }
    }
    if (locationType == LocationActivity.LOCATION_TYPE_SEND_WITH_LIVE) {
        if (position == 1) {
            return 1;
        } else if (position == 2) {
            shareLiveLocationPotistion = position;
            return 6;
        } else if (position == 3) {
            return 9;
        } else if (position == 4) {
            return 2;
        } else if (searching || !searching && places.isEmpty()) {
            return 4;
        } else if (position == places.size() + 5) {
            return 5;
        }
    } else {
        if (position == 1) {
            return 1;
        } else if (position == 2) {
            return 9;
        } else if (position == 3) {
            return 2;
        } else if (searching || !searching && places.isEmpty()) {
            return 4;
        } else if (position == places.size() + 4) {
            return 5;
        }
    }
    return 3;
}
 
Example 4
Source File: LocationActivityAdapter.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getItemViewType(int position) {
    if (position == 0) {
        return 0;
    }
    if (needEmptyView && position == getItemCount() - 1) {
        return 10;
    }
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP_VIEW) {
        return 7;
    }
    if (locationType == LocationActivity.LOCATION_TYPE_GROUP) {
        return 1;
    }
    if (currentMessageObject != null) {
        if (currentLiveLocations.isEmpty()) {
            if (position == 2) {
                return 8;
            }
        } else {
            if (position == 2) {
                return 9;
            } else if (position == 3) {
                return 2;
            } else if (position == 4) {
                shareLiveLocationPotistion = position;
                return 6;
            }
        }
        return 7;
    }
    if (locationType == 2) {
        if (position == 1) {
            shareLiveLocationPotistion = position;
            return 6;
        } else {
            return 7;
        }
    }
    if (locationType == LocationActivity.LOCATION_TYPE_SEND_WITH_LIVE) {
        if (position == 1) {
            return 1;
        } else if (position == 2) {
            shareLiveLocationPotistion = position;
            return 6;
        } else if (position == 3) {
            return 9;
        } else if (position == 4) {
            return 2;
        } else if (searching || !searching && places.isEmpty()) {
            return 4;
        } else if (position == places.size() + 5) {
            return 5;
        }
    } else {
        if (position == 1) {
            return 1;
        } else if (position == 2) {
            return 9;
        } else if (position == 3) {
            return 2;
        } else if (searching || !searching && places.isEmpty()) {
            return 4;
        } else if (position == places.size() + 4) {
            return 5;
        }
    }
    return 3;
}