Comments (5)
I didn't catch it, do you mean disabling focus from the Fancybutton ?
Can you paste the code you've used so i can reproduce the same issue ?
from fancybuttons.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fancy="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:descendantFocusability="blocksDescendants"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/fancy_button"
fancy:fb_textColor="#000000"
fancy:fb_iconPosition="top"
fancy:fb_defaultColor="@android:color/transparent"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
code above is view_icon_btn.xml
public class GridAdapter extends BaseAdapter {
private static final String TAG = GridAdapter.class.getSimpleName();
private Context mContext;
private List<GridItem> mList;
public GridAdapter(Context c, List<GridItem> l) {
mContext = c;
mList = l;
}
@Override
public int getCount() {
return mList.size();
}
@Override
public Object getItem(int position) {
return mList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Log.d(TAG, "getView(), position: " + position);
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.view_icon_btn, parent, false);
}
FancyButton fbtn = ViewHolder.get(convertView, R.id.fancy_button);
GridItem item = mList.get(position);
fbtn.setText..
..
return convertView;
}
}
and this is Adapter of my grid view
mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.d(TAG, "onItemClick(), position: " + position);
MainActivity2 mainActivity2 = (MainActivity2) getActivity();
switch (position) {
case 0:
mainActivity2.switchFragment(DefinitionFragment.newInstance("Section A"));
break;
case 1:
mainActivity2.switchFragment(DailyFragment.newInstance("Section B"));
break;
case 2:
mainActivity2.switchFragment(StatMainFragment.newInstance("Section C"));
break;
case 3:
mainActivity2.switchFragment(LibBookmarkFragment.newInstance("Section D"));
break;
}
}
});
and this is onItemClick Listener.. (but as i mentioned, not called and fancy button.onclick() was called instead.
from fancybuttons.
Have you tried to disable the focus programmatically by doing fbtn.setFocusable(false)
?
Make sure you add it as last instruction on your getView()
from fancybuttons.
Any updates ?
from fancybuttons.
Same problem, and solved after setFocusable programmatically.
Thanks medyo!
from fancybuttons.
Related Issues (20)
- how to set textStyle="bold"
- how to remove the default text and show only drawable icon? HOT 1
- font not loaded HOT 1
- Black buttons that only show text "Fancy Buttons" HOT 5
- how i can set fb_fontIconResource HOT 4
- "fancy:fb_focusColor" not working in 1.9.0 HOT 2
- Auto complete not work
- stop using fancy namespace
- I cannot use implementation "com.android.support:appcompat-v7:$support_lib_version" HOT 1
- Ripple effect on click?
- How can I add gradient background drawable to a button? HOT 1
- When set radius programmatically, ripple effect gone?
- ripple effect doesn't work HOT 3
- 是否能加入对渐变颜色的支持? HOT 4
- Can't make Button text as bold
- Update to Font Awesome 5.8.2
- Method ‘setFontIconSize’ can‘t work when I put my iconresource in drawable and import it by using R.drawable.xxx HOT 1
- fb_textSize , fb_textAllCaps not work
- Dead library?
- Your library no longer works HOT 1
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 fancybuttons.