use of com.tencent.wstt.gt.InPara in project GT by Tencent.
the class ConnectedState method getInPara.
@Override
public int getInPara(String paraName, int origVal, boolean isGlobal) {
// connected态的这个方法需要直接调aidl接口
InPara iv = getInPara(paraName, isGlobal);
int result = origVal;
if (null != iv) {
if (InPara.DISPLAY_DISABLE == iv.getDisplayProperty()) {
result = origVal;
} else {
List<String> vals = iv.getValues();
String val = vals.get(0);
if (val.equals("<null>")) {
result = 0;
} else if (matchInParaType(val, "int")) {
result = Integer.parseInt(vals.get(0));
}
}
}
return result;
}
use of com.tencent.wstt.gt.InPara in project GT by Tencent.
the class ConnectedState method getInPara.
@Override
public byte getInPara(String paraName, byte origVal, boolean isGlobal) {
// connected态的这个方法需要直接调aidl接口
InPara iv = getInPara(paraName, isGlobal);
byte result = origVal;
if (null != iv) {
if (InPara.DISPLAY_DISABLE == iv.getDisplayProperty()) {
result = origVal;
} else {
List<String> vals = iv.getValues();
String val = vals.get(0);
if (val.equals("<null>")) {
result = 0;
} else if (matchInParaType(val, "byte")) {
result = Byte.parseByte(vals.get(0));
}
}
}
return result;
}
use of com.tencent.wstt.gt.InPara in project GT by Tencent.
the class ConnectedState method getInPara.
@Override
public char getInPara(String paraName, char origVal, boolean isGlobal) {
// connected态的这个方法需要直接调aidl接口
InPara iv = getInPara(paraName, isGlobal);
char result = origVal;
if (null != iv) {
if (InPara.DISPLAY_DISABLE == iv.getDisplayProperty()) {
result = origVal;
} else {
List<String> vals = iv.getValues();
String val = vals.get(0);
if (val.equals("<null>")) {
result = 0;
} else {
result = val.charAt(0);
}
}
}
return result;
}
use of com.tencent.wstt.gt.InPara in project GT by Tencent.
the class ConnectedState method getInPara.
@Override
public long getInPara(String paraName, long origVal, boolean isGlobal) {
// connected态的这个方法需要直接调aidl接口
InPara iv = getInPara(paraName, isGlobal);
long result = origVal;
if (null != iv) {
if (InPara.DISPLAY_DISABLE == iv.getDisplayProperty()) {
result = origVal;
} else {
List<String> vals = iv.getValues();
String val = vals.get(0);
if (val.equals("<null>")) {
result = 0;
} else if (matchInParaType(val, "long")) {
result = Long.parseLong(vals.get(0));
}
}
}
return result;
}
use of com.tencent.wstt.gt.InPara in project GT by Tencent.
the class GTParamInEditListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ParamConst.ViewHolderDrag switch_drag = null;
InPara o = (InPara) list.get(position);
String key = o.getKey();
final String alias = o.getAlias();
final int type = getItemViewType(position);
/*
* 根据每行UI的类型进行UI模型准备与数据准备
*/
switch(type) {
case TYPE_PROMPT_ITEM:
convertView = PROMPT_ITEM_convertView;
if (((InPara) list.get(1)).getKey().equals(ParamConst.DIVID_TITLE)) {
PROMPT_ITEM_title.setText(ParamConst.PROMPT_INIT_TITLE);
} else {
PROMPT_ITEM_title.setText(ParamConst.PROMPT_TITLE);
}
break;
case TYPE_DIVIDE_ITEM:
convertView = DIVIDE_ITEM_convertView;
if (position == 1) {
DIVIDE_ITEM_top_border.setVisibility(View.GONE);
} else {
DIVIDE_ITEM_top_border.setVisibility(View.VISIBLE);
}
break;
case TYPE_DISABLE_ITEM:
convertView = DISABLE_ITEM_convertView;
if (2 == position || position > 1 && ((InPara) list.get(position - 1)).getKey().equals(ParamConst.DIVID_TITLE)) {
DISABLE_ITEM_top_border.setVisibility(View.GONE);
} else {
DISABLE_ITEM_top_border.setVisibility(View.VISIBLE);
}
break;
case TYPE_SWITCH_ITEM:
if (convertView == null) {
convertView = mInflater.inflate(R.layout.gt_edit_list_item, null);
switch_drag = new ParamConst.ViewHolderDrag();
switch_drag.tv_key = (TextView) convertView.findViewById(R.id.draglist_key);
switch_drag.tv_alias = (TextView) convertView.findViewById(R.id.draglist_shotkey);
switch_drag.tv_listview_bottom_border = (TextView) convertView.findViewById(R.id.listrow_bottom_border);
convertView.setTag(switch_drag);
} else {
switch_drag = (ParamConst.ViewHolderDrag) convertView.getTag();
}
switch_drag.tv_key.setText(key);
switch_drag.tv_alias.setText(alias);
if (position == (list.size() - 1)) {
switch_drag.tv_listview_bottom_border.setVisibility(View.VISIBLE);
} else {
switch_drag.tv_listview_bottom_border.setVisibility(View.GONE);
}
if (list.size() == 2) {
switch_drag.tv_listview_bottom_border.setVisibility(View.GONE);
}
int disable_titile_pos = IpUIManager.getInListDisableTitlePosition();
if (position > disable_titile_pos) {
switch_drag.tv_key.setTextColor(Color.GRAY);
switch_drag.tv_alias.setTextColor(Color.GRAY);
} else {
switch_drag.tv_key.setTextColor(Color.WHITE);
switch_drag.tv_alias.setTextColor(Color.WHITE);
}
break;
}
return convertView;
}