80,355
社区成员
发帖
与我相关
我的任务
分享
<LinearLayout android:id="@+id/concontainer"
android:orientation="horizontal"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:gravity="center_horizontal"
>
<ImageView android:id="@+id/comment"
android:src="@drawable/comment"
android:scaleType="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
/>
<TextView android:id="@+id/commentnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17dip"
android:layout_marginLeft="2dip"
android:layout_marginTop="5dip"
/>
</LinearLayout>
public View.OnClickListener comment_click = new View.OnClickListener(){
@Override
public void onClick(View v)
{
AlertDialog.Builder builder;
AlertDialog alertDialog;
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_dialog, null);
builder = new AlertDialog.Builder(mContext);
builder.setView(layout);
ViewGroup cvp = (ViewGroup)v.getParent();
final TextView goodsnum = (TextView)cvp.findViewById(R.id.commentnum);
……
builder.setPositiveButton(R.string.commit_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
…………
try
{
JSONObject jsobj = new JSONObject(strResult);
JSONObject obj = jsobj.getJSONObject("data");
goodsnum.setText(obj.getString("commentsnum") + SCConstants.COMMENTSNUM);
}
catch (JSONException e)
{
e.printStackTrace();
}
Toast.makeText(mContext, value,
Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton(R.string.comment_cancl,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.cancel();
}
});
alertDialog = builder.create();
alertDialog.show();
}
};
int visStart = listMusic.getFirstVisiblePosition();
int visEnd = listMusic.getLastVisiblePosition();
TextView tvTitle, tvSinger, tvTextt;
int index = MusicService.mPlayPosition - visStart;
if ( index >= 0 && index <= visEnd - visStart) {
tvTitle = (TextView)(listMusic.getChildAt(index).findViewById(R.id.ItemTitle));
tvTitle.setTextColor(libraryMusicTitleFontColor);
tvSinger = (TextView)(listMusic.getChildAt(index).findViewById(R.id.ItemSinger));
tvSinger.setTextColor(libraryArtistFontColor);
tvTextt = (TextView)(listMusic.getChildAt(index).findViewById(R.id.ItemTime));
tvTextt.setTextColor(libraryArtistFontColor);
}