Comments (5)
use the lib version 1.1.0 or remove the // rectStrokePaint.setColor(strokeColor);
// rectStrokePaint.setStrokeWidth(strokeWidth);
in LabelViewHelper.
from labelview.
I ended up using app:label_strokeColor="@android:color/transparent"
to remove border. You can set your desire color.
from labelview.
plz show ur code
from labelview.
layout looks like this
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_marginRight="4dp"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.lid.lib.LabelImageView android:id="@+id/icon" android:layout_width="80dp" android:layout_height="80dp" android:scaleType="centerCrop" app:label_backgroundColor="?attr/colorAccent" app:label_orientation="LEFT_TOP" app:label_text="CHINA" app:label_textSize="@dimen/text_size_tertiary" /> <!--<ImageView android:layout_width="100dp" android:layout_height="100dp" android:id="@+id/download_icon" app:srcCompat="@drawable/ic_download"/>--> </FrameLayout> <TextView android:id="@+id/text_view" android:layout_width="80dp" android:layout_height="wrap_content" android:text="theme1" android:gravity="center" android:textSize="@dimen/text_size_primary" /> </LinearLayout>
and Here is Adapter Code
`private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>{
private Context context;
public MyAdapter(Context context) {
this.context=context;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.theme_recycler_item,parent,false));
}
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
Glide.with(context).load(themes.get(position).getIconURL()).into(holder.icon);
holder.textView.setText(themes.get(position).getName());
if (themes.get(position).isDownloaded&&themes.get(position).isValid()) {
String str=sharedPreferences.getString(Constants.SHAREDPREF.THEME, "no_theme");
if (str.equals("no_theme")&&position==0){
holder.icon.setLabelText("Active");
holder.icon.setLabelTextColor(Color.WHITE);
holder.icon.setLabelVisual(true);
holder.icon.setLabelBackgroundColor(ContextCompat.getColor(getActivity(), R.color.green));
//holder.download_icon.setImageResource(R.drawable.ic_check_green);
} else if (themes.get(position).getName().equals(str)) {
holder.icon.setLabelText("Active");
holder.icon.setLabelTextColor(Color.WHITE);
holder.icon.setLabelVisual(true);
holder.icon.setLabelBackgroundColor(ContextCompat.getColor(getActivity(), R.color.green));
//holder.download_icon.setImageResource(R.drawable.ic_check_green);
} else {
//holder.icon.setLabelText("");
//holder.icon.setLabelTextColor(Color.TRANSPARENT);
holder.icon.setLabelVisual(false);
//holder.download_icon.setImageResource(R.drawable.ic_check);
}
} else {
holder.icon.setLabelText("buy now");
holder.icon.setLabelTextColor(Color.WHITE);
holder.icon.setLabelVisual(true);
holder.icon.setLabelBackgroundColor(ContextCompat.getColor(getActivity(), R.color.red));
//holder.download_icon.setImageResource(R.drawable.ic_download);
}
}
@Override
public int getItemCount() {
return themes.size();
}
class ViewHolder extends RecyclerView.ViewHolder{
LabelImageView icon;
TextView textView;
public ViewHolder(View itemView) {
super(itemView);
icon=(LabelImageView) itemView.findViewById(R.id.icon);
//download_icon=(ImageView) itemView.findViewById(R.id.download_icon);
textView=(TextView) itemView.findViewById(R.id.text_view);
}
}
}`
from labelview.
@brije111 Did you ever find solution for this one?
from labelview.
Related Issues (20)
- Possible to set an image instead of text? HOT 1
- Simple Rotate TextView HOT 1
- labelview.remove() can't work HOT 1
- It became a strip HOT 1
- looking forward to see this awesome widget in jcenter/maven HOT 4
- multiple lines label HOT 5
- Problem in Base Adapter HOT 5
- Curiosity HOT 1
- labelview显示的bug,过一会会由斜着的变成横着的 HOT 1
- Can i set Custom tag background
- How to change font of label HOT 1
- Support Gravity End and Start!
- Grammatical error
- ¿ How to remove ? HOT 4
- request for a gradle HOT 1
- view problem HOT 6
- Use in XML HOT 3
- Use in RecyclerView HOT 13
- Use in recyclerview
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labelview.