2016-06-13 13 views
0

私を助けてください。Androidスタジオナビゲーションドロワー - 右側の矢印アイコンを追加

ナビゲーションの右側に矢印アイコンを追加するにはどうすればよいですか?

例:

ホーム                                                           >


CATEGORY                                        >


MY ACCOUNT                              >


は、ここに私のコードです。ここ

JSONObject jsonObj = new JSONObject(CATEGORIESJSON); 
categories = jsonObj.getJSONArray(CATEGORIES_RESULTS); 

listDataHeader = new ArrayList<String>(); 
listDataChild = new HashMap<String, List<Category>>(); 

// Adding group data 
listDataHeader.add("HOME"); 
listDataHeader.add("CATEGORY"); 
listDataHeader.add("MY ACCOUNT"); 
listDataHeader.add("REFER A FRIEND"); 
listDataHeader.add("ABOUT"); 
listDataHeader.add("PRIVACY POLICY"); 
listDataHeader.add("SHIPPING TERMS"); 
listDataHeader.add("SHOPPING GUIDE"); 
listDataHeader.add("CONTACT US"); 
if(customersid.matches("10865")){ 
    listDataHeader.add("LOGIN"); 
}else{ 
    listDataHeader.add("LOGOUT"); 
} 

List<Category> CATEGORY = new ArrayList<Category>(); 
for(int i=0;i<categories.length();i++){ 
    JSONObject c = categories.getJSONObject(i); 
    Category category = new Category(); 
    category.name = c.getString(CATEGORIES_NAME); 
    category.id = c.getString(CATEGORIES_ID); 
    category.image2 = c.getString(CATEGORIES_IMAGE2); 

    CATEGORY.add(category); 
} 

listDataChild.put(listDataHeader.get(1), CATEGORY); // Header, Child data 

は私を助けてください、私のExpandableListAdapterコード

package com.example.administrator.mosbeau; 

import android.content.Context; 
import android.graphics.Typeface; 
import android.view.LayoutInflater; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.BaseExpandableListAdapter; 
import android.widget.ExpandableListView; 
import android.widget.TextView; 

import java.util.HashMap; 
import java.util.List; 


/** 
* Created by Administrator on 9/21/2015. 
*/ 

@SuppressWarnings("deprecation") 

public class ExpandableListAdapter extends BaseExpandableListAdapter { 

    private Context _context; 
    private List<String> _listDataHeader; // header titles 
    // child data in format of header title, child title 
    private HashMap<String, List<Category>> _listDataChild; 

    public ExpandableListAdapter(Context context, List<String> listDataHeader, 
           HashMap<String, List<Category>> listChildData) { 
     this._context = context; 
     this._listDataHeader = listDataHeader; 
     this._listDataChild = listChildData; 
    } 

    @Override 
    public Category getChild(int groupPosition, int childPosititon) { 
     return this._listDataChild.get(this._listDataHeader.get(groupPosition)) 
       .get(childPosititon); 
    } 

    @Override 
    public long getChildId(int groupPosition, int childPosition) { 
     return childPosition; 
    } 

    @Override 
    public View getChildView(int groupPosition, final int childPosition, 
          boolean isLastChild, View convertView, ViewGroup parent) { 

     final Category childCategory = (Category) getChild(groupPosition, childPosition); 

     if (convertView == null) { 
      LayoutInflater infalInflater = (LayoutInflater) this._context 
        .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
      convertView = infalInflater.inflate(R.layout.list_item, null); 
     } 

     TextView txtListChild = (TextView) convertView 
       .findViewById(R.id.lblListItem); 

     txtListChild.setText(childCategory.name); 
     return convertView; 
    } 

    @Override 
    public int getChildrenCount(int groupPosition) { 
     return this._listDataChild.get(this._listDataHeader.get(groupPosition)) 
       .size(); 
    } 

    @Override 
    public Object getGroup(int groupPosition) { 
     return this._listDataHeader.get(groupPosition); 
    } 

    @Override 
    public int getGroupCount() { 
     return this._listDataHeader.size(); 
    } 

    @Override 
    public long getGroupId(int groupPosition) { 
     return groupPosition; 
    } 

    @Override 
    public View getGroupView(int groupPosition, boolean isExpanded, 
          View convertView, ViewGroup parent) { 
     String headerTitle = (String) getGroup(groupPosition); 
     if (convertView == null) { 
      LayoutInflater infalInflater = (LayoutInflater) this._context 
        .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
      convertView = infalInflater.inflate(R.layout.list_group, null); 
     } 

     TextView lblListHeader = (TextView) convertView 
       .findViewById(R.id.lblListHeader); 
     lblListHeader.setTypeface(null, Typeface.BOLD); 
     lblListHeader.setText(headerTitle); 

     ExpandableListView mExpandableListView = (ExpandableListView) parent; 
     mExpandableListView.expandGroup(1); 

     return convertView; 
    } 

    @Override 
    public boolean hasStableIds() { 
     return false; 
    } 

    @Override 
    public boolean isChildSelectable(int groupPosition, int childPosition) { 
     return true; 
    } 
} 

です。

おかげで、

+0

を持つアダプタのコード –

+0

を表示し、編集を参照してください。 – Joehamir

答えて

1

はあなたのxmlレイアウトのために 'を含む' タグの使用について知っている

ジョー?

私はこれを行うにあなたのためのいくつかの参照を持っていると思う。これlinkを参照してください、それは良い、について説明

関連する問題