通过以下方式启用prodmode后,有没有办法访问ng
对象:
enableProdMode();
答案 0 :(得分:1)
不支持此功能。
public class SectionAccompliceAdapter extends com.applidium.headerlistview.SectionAdapter {
private MainActivity mainActivity;
private Realm realm;
private List<Accomplice_groups> accomplice_groupses;
private List<Map<String, Object>> maps;
private Colors colors;
private List<String> mapField, mapFieldSup;
private String value ="";
private FieldFormContact field;
public SectionAccompliceAdapter(MainActivity mainActivity, List<Accomplice_groups> accomplice_groupses, Colors colors) {
this.mainActivity = mainActivity;
this.colors = colors;
realm = Realm.getInstance(mainActivity);
mapField = new ArrayList<>();
maps = new ArrayList<Map<String,Object>>();
this.accomplice_groupses = accomplice_groupses;
}
@Override
public int numberOfSections() {
return accomplice_groupses.size();
}
@Override
public int numberOfRows(int section)
{
if(section == -1)
section = 0;
return accomplice_groupses.get(section).getAccomplices().size();
}
@Override
public View getRowView(int section, final int row, View convertView, ViewGroup parent) {
Map<String, Object> map;
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
LayoutInflater inflater = mainActivity.getLayoutInflater();
convertView = inflater.inflate(R.layout.listview_item, null);
holder.textView1 = (TextInputLayout) convertView.findViewById(R.id.textViewItem);
holder.editText1 = (EditText) convertView.findViewById(R.id.editTextItem);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
Accomplice accomplice = accomplice_groupses.get(section).getAccomplices().get(row);// realm.where(Accomplice.class).equalTo("id", id).findFirst();
if (accomplice != null && accomplice.getField() != null)
{
field = accomplice.getField();
holder.textView1.setHint(field.getLabel());
holder.editText1.setText(viwer.getData());
TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence c, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
mapField.add( editable.toString());
}
};
holder.editText1.addTextChangedListener(watcher);
holder.editText1.setImeOptions(EditorInfo.IME_ACTION_NEXT);
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(50);
holder.editText1.setFilters(FilterArray);
}
return convertView;
}
@Override
public Object getRowItem(int section, int row) {
return null;
}
public List<Map<String, Object>> getMapViews() {
return maps;
}
public void setMapsViews(List<Map<String, Object>> maps) {
this.maps = maps;
}
@Override
public View getSectionHeaderView(int section, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = (TextView) mainActivity.getLayoutInflater().inflate(mainActivity.getResources().getLayout(android.R.layout.simple_list_item_1), null);
}
section = section+1;
((TextView) convertView).setText("Complice : " +section );
switch (section) {
case 1:
convertView.setBackgroundColor(mainActivity.getResources().getColor(R.color.Color_13));
break;
...
}
return convertView;
}
@Override
public boolean hasSectionHeaderView(int section) {
return true;
}
@Override
public void onRowItemClick(AdapterView<?> parent, View view, int section, int row, long id) {
super.onRowItemClick(parent, view, section, row, id);
}
class ViewHolder {
TextInputLayout textView1;
EditText editText1;
}
是一种性能优化模式,不包括调试“stuff”。
即使prodMode
返回CompilerConfig
true
genDebugInfo()
isDevMode()
我只是假设false
启用/禁用genDebugInfo()
但未仔细检查。