Skip to content

Commit

Permalink
optimize onDraw method and code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Fang authored and Jay Fang committed Aug 17, 2015
1 parent fb80ee7 commit 96d390f
Show file tree
Hide file tree
Showing 2 changed files with 238 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
Expand Down Expand Up @@ -40,29 +39,29 @@ protected void onCreate(Bundle savedInstanceState) {

mMenu=(DropDownMenu)findViewById(R.id.menu);

mMenu.setMenuCount(3);
mMenu.setShowCount(6);
mMenu.setmMenuCount(3);
mMenu.setmShowCount(6);
mMenu.setShowCheck(true);
mMenu.setMenuTitleTextSize(16);
mMenu.setMenuTitleTextColor(Color.WHITE);
mMenu.setMenuListTextSize(16);
mMenu.setMenuListTextColor(Color.BLACK);
mMenu.setMenuBackColor(Color.GRAY);
mMenu.setMenuPressedBackColor(Color.WHITE);
mMenu.setmMenuTitleTextSize(16);
mMenu.setmMenuTitleTextColor(Color.parseColor("#777777"));
mMenu.setmMenuListTextSize(16);
mMenu.setmMenuListTextColor(Color.BLACK);
mMenu.setmMenuBackColor(Color.parseColor("#eeeeee"));
mMenu.setmMenuPressedBackColor(Color.WHITE);
mMenu.setmMenuPressedTitleTextColor(Color.BLACK);

mMenu.setCheckIcon(R.drawable.ico_make);
mMenu.setmCheckIcon(R.drawable.ico_make);

mMenu.setUpArrow(R.drawable.arrow_up);
mMenu.setDownArrow(R.drawable.arrow_down);
mMenu.setmUpArrow(R.drawable.arrow_up);
mMenu.setmDownArrow(R.drawable.arrow_down);

mMenu.setDefaultMenuTitle(strings);


mMenu.setShowDivider(false);
mMenu.setMenuListBackColor(getResources().getColor(R.color.white));
mMenu.setMenuListSelectorRes(R.color.white);
mMenu.setArrowMarginTitle(20);
mMenu.setMenuPressedTitleTextColor(Color.BLACK);
mMenu.setmMenuListBackColor(getResources().getColor(R.color.white));
mMenu.setmMenuListSelectorRes(R.color.white);
mMenu.setmArrowMarginTitle(20);

mMenu.setMenuSelectedListener(new OnMenuSelectedListener() {
@Override
Expand All @@ -79,29 +78,30 @@ public void onSelected(View listview, int RowIndex, int ColumnIndex) {
setFilter();
}
});
// List<String[]> items = new ArrayList<>();
// items.add(arr1);
// items.add(arr2);
// items.add(arr3);
// mMenu.setMenuItems(items);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
List<String[]> items = new ArrayList<>();
items.add(arr1);
items.add(arr2);
items.add(arr3);
mMenu.setMenuItems(items);
List<String[]> items = new ArrayList<>();
items.add(arr1);
items.add(arr2);
items.add(arr3);
mMenu.setmMenuItems(items);

// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// List<String[]> items = new ArrayList<>();
// items.add(arr1);
// items.add(arr2);
// items.add(arr3);
// mMenu.setmMenuItems(items);
//
// }
// }, 1000);

}
}, 1000);
mMenu.setIsDebug(false);

mList=(ListView)findViewById(R.id.lv_list);
data=getData();
mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, data));


}

private void setFilter(){
Expand Down
Loading

0 comments on commit 96d390f

Please sign in to comment.