本文整理汇总了Java中com.ns.developer.tagview.widget.TagCloudLinkView类的典型用法代码示例。如果您正苦于以下问题:Java TagCloudLinkView类的具体用法?Java TagCloudLinkView怎么用?Java TagCloudLinkView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TagCloudLinkView类属于com.ns.developer.tagview.widget包,在下文中一共展示了TagCloudLinkView类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View inflatedView =inflater.inflate(R.layout.fragment_proyecto, container, false);
TextView descripcionProyecto = (TextView) inflatedView.findViewById(R.id.descripcion_proyecto);
TextView fechaCreacion = (TextView) inflatedView.findViewById(R.id.fecha_creacion);
TextView fechaFinalizacion = (TextView) inflatedView.findViewById(R.id.fecha_finalizacion);
TagCloudLinkView areasProyecto = (TagCloudLinkView) inflatedView.findViewById(R.id.areas_proyecto);
descripcionProyecto.setText(proyecto.getDescripcion());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
fechaCreacion.setText(simpleDateFormat.format(proyecto.getFechaCreacion()));
fechaFinalizacion.setText(simpleDateFormat.format(proyecto.getFechaFinalizacion()));
for (Area a : proyecto.getMisAreas()) {
areasProyecto.add(new Tag(a.getId(), a.getNombre()));
}
return inflatedView;
}
示例2: printTags
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
/**
* Get tags for a place from database and print them to the view.
*/
protected void printTags() {
LinearLayout layout = (LinearLayout) findViewById(R.id.details_tags_layout);
List<String> tags = this.tagManager.getTags(this.place);
if (tags == null || tags.isEmpty()) {
layout.setVisibility(View.GONE);
} else {
layout.setVisibility(View.VISIBLE);
TagCloudLinkView view = (TagCloudLinkView) findViewById(R.id.details_tags);
view.getTags().clear();
for (String tag : tags) {
view.add(new Tag(1, tag));
}
view.drawTags();
}
}
示例3: onCreate
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.placeManager = MyPlacesApplication.getPlaceManager();
setContentView(R.layout.activity_add_edit);
Button btn = (Button) findViewById(R.id.button);
btn.setText(R.string.button_add_place);
final TagCloudLinkView view = (TagCloudLinkView) findViewById(R.id.tags);
view.setOnTagDeleteListener(new TagCloudLinkView.OnTagDeleteListener() {
@Override
public void onTagDeleted(Tag tag, int i) { }
});
view.drawTags();
}
示例4: ViewHolder
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
public ViewHolder(View itemView, int viewType) {
super(itemView);
if (viewType == VIEW_TYPE_ACTIVITY) {
nombreUsuario = (TextView) itemView.findViewById(R.id.nombre_usuario);
statusUsuario = (TextView) itemView.findViewById(R.id.status_usuario);
seguidoresUsuario = (TextView) itemView.findViewById(R.id.seguidores_usuario);
especialidadUsuario = (TagCloudLinkView) itemView.findViewById(R.id.especialidad_usuario);
imgUsuario = (ImageView) itemView.findViewById(R.id.img_usuario);
seguirUsuario = (Button) itemView.findViewById(R.id.seguir_usuario);
tipoView = 1;
} else {
tipoView = 0;
}
}
示例5: getPlaceStringDescriptor
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
/**
* @return info about provided place
*/
protected PlaceStringDescriptor getPlaceStringDescriptor() {
TextView nameView = (TextView) findViewById(R.id.name);
TextView commentView = (TextView) findViewById(R.id.comment);
TextView addressView = (TextView) findViewById(R.id.address);
TextView cityView = (TextView) findViewById(R.id.city);
TextView countryView = (TextView) findViewById(R.id.country);
ImageView img = (ImageView) findViewById(R.id.img);
RatingBar rating = (RatingBar) findViewById(R.id.rating_bar);
TagCloudLinkView tagView = (TagCloudLinkView) findViewById(R.id.tags);
List<String> tagNames = new ArrayList<>();
for (Tag t : tagView.getTags()) {
tagNames.add(t.getText());
}
PlaceStringDescriptor placeDescription = new PlaceStringDescriptor();
placeDescription.setName(nameView.getText().toString().trim());
placeDescription.setRating(Math.round(rating.getRating()));
placeDescription.setAddress(addressView.getText().toString().trim());
placeDescription.setCity(cityView.getText().toString().trim());
placeDescription.setCountry(countryView.getText().toString().trim());
placeDescription.setComment(commentView.getText().toString().trim());
placeDescription.setTags(tagNames);
if (!placeDescription.validate(this)) {
return null;
}
if (this.imgSet) {
placeDescription.setImage(img.getDrawable());
}
return placeDescription;
}
示例6: onCreateView
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//Pongo los iconos para los TextView
Iconify.with(new FontAwesomeModule());
View inflatedView =inflater.inflate(R.layout.fragment_usuario, container, false);
TextView nombreCompleto = (TextView) inflatedView.findViewById(R.id.nombre_completo_usuario);
TextView status = (TextView) inflatedView.findViewById(R.id.status_usuario);
TextView web = (TextView) inflatedView.findViewById(R.id.web_usuario);
TextView biografia = (TextView) inflatedView.findViewById(R.id.biografia_usuario);
ImageView verficado =(ImageView) inflatedView.findViewById(R.id.verificado);
TagCloudLinkView areasInteres = (TagCloudLinkView) inflatedView.findViewById(R.id.areas_interes_usuario);
TagCloudLinkView especialidades = (TagCloudLinkView) inflatedView.findViewById(R.id.especialidades_usuario);
RecyclerView redesSociales =(RecyclerView) inflatedView.findViewById(R.id.redesSociales);
//Establezco el recyclerview con las redes sociales
LinearLayoutManager llm = new LinearLayoutManager(getContext());
llm.setOrientation(LinearLayoutManager.HORIZONTAL);
redesSociales.setLayoutManager(llm);
redesSociales.setAdapter(new AdapterRedesSociales(getContext(),usuario.getMisRedesSociales()));
//Relleno los campos del usuario
if(usuario.getApellidos()!=null)
nombreCompleto.setText(usuario.getNombre()+" "+usuario.getApellidos());
else
nombreCompleto.setText(usuario.getNombre());
status.setText(usuario.getMiStatus().getNombre());
if(usuario.isVerificado())
verficado.setVisibility(View.VISIBLE);
else
verficado.setVisibility(View.GONE);
if(usuario.getWeb()!=null && usuario.getWeb().compareTo("")!=0)
web.setText(usuario.getWeb());
else
{
web.setVisibility(View.GONE);
inflatedView.findViewById(R.id.text_web).setVisibility(View.GONE);
}
if(usuario.getBiografia()!=null && usuario.getBiografia().compareTo("")!=0)
biografia.setText(usuario.getBiografia());
else
{
biografia.setVisibility(View.GONE);
inflatedView.findViewById(R.id.text_biografia).setVisibility(View.GONE);
}
if(usuario.getMisEspecialidades().size()>0){
for (Especialidad e : usuario.getMisEspecialidades()) {
especialidades.add(new Tag(e.getId(), e.getNombre()));
}
}else {
especialidades.setVisibility(View.GONE);
inflatedView.findViewById(R.id.text_especialidades).setVisibility(View.GONE);
}
if(usuario.getMisAreasInteres().size()>0){
for (Area a : usuario.getMisAreasInteres()) {
areasInteres.add(new Tag(a.getId(), a.getNombre()));
}
}else {
areasInteres.setVisibility(View.GONE);
inflatedView.findViewById(R.id.text_areas_interes).setVisibility(View.GONE);
}
return inflatedView;
}
示例7: addTag
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
/**
* Add tag onClick event.
*/
public void addTag(View view) {
TagCloudLinkView tagView = (TagCloudLinkView) findViewById(R.id.tags);
invokeAddTagDialog(this, view, tagView);
}
示例8: getItemView
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
@Override
public View getItemView(ParseObject event, View convertView, ViewGroup parent) {
if(convertView==null){
convertView= LayoutInflater.from(parent.getContext()).inflate(R.layout.cell_event, parent, false);
}
aqCell.recycle(convertView);
aqCell.id(R.id.text1).text(event.getString("hospital"));
aqCell.id(R.id.textDate).text(StringUtils.formatDate(event.getDate("startTime"), StringUtils.DATE_AND_TIME_SHORT));
int duration = event.getInt("duration");
int clockRes = Reflect.getImageResId("ic_clock_" + duration);
if (clockRes==0)clockRes=R.drawable.ic_clock_60;
aqCell.id(R.id.imgDate).image(clockRes);
String category = event.getString("category");
category = StringUtils.isNullOrEmpty(category, "lecture").toLowerCase();
int categoryRes = Reflect.getImageResId("ic_event_" + category);
if(categoryRes==0) categoryRes=R.drawable.ic_event_lecture;
aqCell.id(R.id.imgCategory).image(categoryRes);
List<String> tags = event.getList("tags");
if(tags==null) tags = new ArrayList<>();
TagCloudLinkView hashTags = (TagCloudLinkView) aqCell.id(R.id.hashtag_tags).getView();
while(hashTags.getTags().size()>0){
hashTags.remove(0);
}
for(String tag : tags){
hashTags.add(new Tag(1, tag));
}
hashTags.drawTags();
ParseObject owner = event.getParseObject("owner");
if(owner!=null)
aqCell.id(R.id.textOwnerName).text(String.format("%s %s", owner.get("firstName"), owner.get("lastName")));
else
aqCell.id(R.id.textOwnerName).text("");
int headCount = event.getInt("headCount");
int quota = event.getInt("quota");
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
if(headCount>=quota)
StringUtils.appendSpan(stringBuilder, ""+headCount, new ForegroundColorSpan(getResources().getColor(R.color.body_text_1_negative)));
else
stringBuilder.append(""+headCount);
stringBuilder.append(String.format("/%d places taken", quota));
aqCell.id(R.id.textHeadCount).text(stringBuilder);
return convertView;
}
示例9: modelToUI
import com.ns.developer.tagview.widget.TagCloudLinkView; //导入依赖的package包/类
private void modelToUI() {
ParseObject event = mEvent;
aq.id(R.id.textHospitalName).text(event.getString("hospital"));
String location = event.getString("location");
location+=" "+StringUtils.isNullOrEmpty(event.getString("room"), "");
aq.id(R.id.textLocation).text(location);
aq.id(R.id.textDate).text(StringUtils.formatDate(event.getDate("startTime"), StringUtils.DATE_AND_TIME_SHORT));
int duration = event.getInt("duration");
int clockRes = Reflect.getImageResId("ic_clock_" + duration);
if (clockRes==0)clockRes=R.drawable.ic_clock_60;
aq.id(R.id.imgDate).image(clockRes);
String category = event.getString("category");
category = StringUtils.isNullOrEmpty(category, "lecture").toLowerCase();
int categoryRes = Reflect.getImageResId("ic_event_" + category);
if(categoryRes==0) categoryRes=R.drawable.ic_event_lecture;
aq.id(R.id.imgCategory).image(categoryRes);
List<String> tags = event.getList("tags");
if(tags==null) tags = new ArrayList<>();
TagCloudLinkView hashTags = (TagCloudLinkView) aq.id(R.id.hashtag_tags).getView();
while(hashTags.getTags().size()>0){
hashTags.remove(0);
}
for(String tag : tags){
hashTags.add(new Tag(1, tag));
}
hashTags.drawTags();
ParseObject owner = event.getParseObject("owner");
if(owner!=null)
aq.id(R.id.textOwnerName).text(String.format("%s %s", owner.get("firstName"), owner.get("lastName")));
else
aq.id(R.id.textOwnerName).text("");
aq.id(R.id.textBlurb).text(event.getString("blurb"));
int headCount = event.getInt("headCount");
int quota = event.getInt("quota");
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
if(headCount>=quota)
StringUtils.appendSpan(stringBuilder, ""+headCount, new ForegroundColorSpan(getResources().getColor(R.color.body_text_1_negative)));
else
stringBuilder.append(""+headCount);
stringBuilder.append(String.format("/%d places taken", quota));
aq.id(R.id.textHeadCount).text(stringBuilder);
ParseUser user = ParseUser.getCurrentUser();
if(user!=null && owner!=null && user.getObjectId().equals(owner.getObjectId())){
aq.id(R.id.btn_submit).text("Cancel").enabled(false);
}
else{
aq.id(R.id.btn_submit).text("Reserve").enabled(!mHasJoined);
}
}