Improved borderless button

This commit is contained in:
daniel oeh 2012-06-20 20:59:35 +02:00
parent 27f34cac6e
commit 088a1ad673
7 changed files with 39 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="#33B5E5" />
</shape></item>
<item android:state_focused="true"><shape android:shape="rectangle">
<solid android:color="#33B5E5" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />
</shape></item>
</selector>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="#33B5E5" />
<solid android:color="#FEBB20" />
</shape></item>
<item android:state_focused="true"><shape android:shape="rectangle">
<solid android:color="#33B5E5" />
<solid android:color="#FEBB20" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />

View File

@ -13,14 +13,25 @@
android:layout_height="wrap_content"
android:layout_below="@id/txtvItemname"
/>
<Button
<ImageButton
android:id="@+id/butAction"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="More"
android:padding="8dp"
android:src="@drawable/navigation_expand"
android:background="@drawable/borderless_button"
android:layout_alignParentRight="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
/>
<ImageView
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:src="@drawable/vertical_divider"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="28dp"
android:focusable="false"/>
</RelativeLayout>

View File

@ -7,6 +7,7 @@ import de.podfetcher.util.Converter;
import de.podfetcher.R;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.view.LayoutInflater;
import android.view.View;
@ -35,7 +36,7 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
convertView = inflater.inflate(R.layout.feeditemlist_item, null);
holder.title = (TextView) convertView.findViewById(R.id.txtvItemname);
holder.size = (TextView) convertView.findViewById(R.id.txtvItemsize);
holder.butAction = (Button) convertView.findViewById(R.id.butAction);
holder.butAction = (ImageButton) convertView.findViewById(R.id.butAction);
convertView.setTag(holder);
} else {
@ -49,6 +50,7 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
holder.title.setTypeface(Typeface.DEFAULT);
}
holder.size.setText(Converter.byteToString(item.getMedia().getSize()));
holder.butAction.setFocusable(false);
holder.butAction.setOnClickListener(onButActionClicked);
return convertView;
@ -57,6 +59,6 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
static class Holder {
TextView title;
TextView size;
Button butAction;
ImageButton butAction;
}
}

View File

@ -24,6 +24,11 @@ import de.podfetcher.storage.DownloadRequester;
import de.podfetcher.syndication.util.FeedItemMenuHandler;
public class FeedItemlistFragment extends SherlockListFragment {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
this.getListView().setItemsCanFocus(true);
}
private static final String TAG = "FeedItemlistFragment";
public static final String EXTRA_SELECTED_FEEDITEM = "extra.de.podfetcher.activity.selected_feeditem";
@ -59,6 +64,8 @@ public class FeedItemlistFragment extends SherlockListFragment {
mActionMode.finish();
}
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {