org.telegram.ui.Cells.SharingLiveLocationCell Java Examples

The following examples show how to use org.telegram.ui.Cells.SharingLiveLocationCell. 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: SharingLocationsAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            SharingLiveLocationCell cell = (SharingLiveLocationCell) holder.itemView;
            cell.setDialog(getLocation(position - 1));
            break;
        }
        case 1: {
            if (textView != null) {
                textView.setText(LocaleController.formatString("SharingLiveLocationTitle", R.string.SharingLiveLocationTitle, LocaleController.formatPluralString("Chats", LocationController.getLocationsCount())));
            }
            break;
        }
    }
}
 
Example #2
Source File: SharingLocationsAlert.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            SharingLiveLocationCell cell = (SharingLiveLocationCell) holder.itemView;
            cell.setDialog(getLocation(position - 1));
            break;
        }
        case 1: {
            if (textView != null) {
                textView.setText(LocaleController.formatString("SharingLiveLocationTitle", R.string.SharingLiveLocationTitle, LocaleController.formatPluralString("Chats", LocationController.getLocationsCount())));
            }
            break;
        }
    }
}
 
Example #3
Source File: SharingLocationsAlert.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            SharingLiveLocationCell cell = (SharingLiveLocationCell) holder.itemView;
            cell.setDialog(getLocation(position - 1));
            break;
        }
        case 1: {
            if (textView != null) {
                textView.setText(LocaleController.formatString("SharingLiveLocationTitle", R.string.SharingLiveLocationTitle, LocaleController.formatPluralString("Chats", LocationController.getLocationsCount())));
            }
            break;
        }
    }
}
 
Example #4
Source File: SharingLocationsAlert.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            SharingLiveLocationCell cell = (SharingLiveLocationCell) holder.itemView;
            cell.setDialog(getLocation(position - 1));
            break;
        }
        case 1: {
            if (textView != null) {
                textView.setText(LocaleController.formatString("SharingLiveLocationTitle", R.string.SharingLiveLocationTitle, LocaleController.formatPluralString("Chats", LocationController.getLocationsCount())));
            }
            break;
        }
    }
}
 
Example #5
Source File: LocationActivityAdapter.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            ((EmptyCell) holder.itemView).setHeight(overScrollHeight);
            break;
        case 1:
            sendLocationCell = (SendLocationCell) holder.itemView;
            updateCell();
            break;
        case 2:
            if (currentMessageObject != null) {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("LiveLocations", R.string.LiveLocations));
            } else if (pulledUp) {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("NearbyPlaces", R.string.NearbyPlaces));
            } else {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("ShowNearbyPlaces", R.string.ShowNearbyPlaces));
            }
            break;
        case 3:
            if (liveLocationType == 0) {
                ((LocationCell) holder.itemView).setLocation(places.get(position - 3), iconUrls.get(position - 3), true);
            } else {
                ((LocationCell) holder.itemView).setLocation(places.get(position - 4), iconUrls.get(position - 4), true);
            }
            break;
        case 4:
            ((LocationLoadingCell) holder.itemView).setLoading(searching);
            break;
        case 6:
            ((SendLocationCell) holder.itemView).setHasLocation(gpsLocation != null);
            break;
        case 7:
            if (currentMessageObject != null && position == 1) {
                ((SharingLiveLocationCell) holder.itemView).setDialog(currentMessageObject, gpsLocation);
            } else {
                ((SharingLiveLocationCell) holder.itemView).setDialog(currentLiveLocations.get(position - (currentMessageObject != null ? 4 : 2)), gpsLocation);
            }
            break;
    }
}
 
Example #6
Source File: LocationActivityAdapter.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            ((EmptyCell) holder.itemView).setHeight(overScrollHeight);
            break;
        case 1:
            sendLocationCell = (SendLocationCell) holder.itemView;
            updateCell();
            break;
        case 2:
            if (currentMessageObject != null) {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("LiveLocations", R.string.LiveLocations));
            } else if (pulledUp) {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("NearbyPlaces", R.string.NearbyPlaces));
            } else {
                ((GraySectionCell) holder.itemView).setText(LocaleController.getString("ShowNearbyPlaces", R.string.ShowNearbyPlaces));
            }
            break;
        case 3:
            if (liveLocationType == 0) {
                ((LocationCell) holder.itemView).setLocation(places.get(position - 3), iconUrls.get(position - 3), true);
            } else {
                ((LocationCell) holder.itemView).setLocation(places.get(position - 4), iconUrls.get(position - 4), true);
            }
            break;
        case 4:
            ((LocationLoadingCell) holder.itemView).setLoading(searching);
            break;
        case 6:
            ((SendLocationCell) holder.itemView).setHasLocation(gpsLocation != null);
            break;
        case 7:
            if (currentMessageObject != null && position == 1) {
                ((SharingLiveLocationCell) holder.itemView).setDialog(currentMessageObject, gpsLocation);
            } else {
                ((SharingLiveLocationCell) holder.itemView).setDialog(currentLiveLocations.get(position - (currentMessageObject != null ? 4 : 2)), gpsLocation);
            }
            break;
    }
}