本文整理汇总了Java中it.gmariotti.changelibs.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于it.gmariotti.changelibs包,在下文中一共展示了R类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAttrs
import it.gmariotti.changelibs.R; //导入依赖的package包/类
/**
* Init custom attrs.
*
* @param attrs
* @param defStyle
*/
protected void initAttrs(AttributeSet attrs, int defStyle) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(
attrs, R.styleable.ChangeLogListView, defStyle, defStyle);
try {
//Layout for rows and header
mRowLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowLayoutId, mRowLayoutId);
mRowHeaderLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowHeaderLayoutId, mRowHeaderLayoutId);
//Changelog.xml file
mChangeLogFileResourceId = a.getResourceId(R.styleable.ChangeLogListView_changeLogFileResourceId, mChangeLogFileResourceId);
mChangeLogFileResourceUrl = a.getString(R.styleable.ChangeLogListView_changeLogFileResourceUrl);
//String which is used in header row for Version
//mStringVersionHeader= a.getResourceId(R.styleable.ChangeLogListView_StringVersionHeader,mStringVersionHeader);
} finally {
a.recycle();
}
}
示例2: getChangeText
import it.gmariotti.changelibs.R; //导入依赖的package包/类
public String getChangeText(Context context) {
if (context == null)
return getChangeText();
String prefix = "";
switch (type) {
case BUGFIX:
prefix = context.getResources().getString(R.string.changelog_row_prefix_bug);
prefix = prefix.replaceAll("\\[", "<").replaceAll("\\]", ">");
break;
case IMPROVEMENT:
prefix = context.getResources().getString(R.string.changelog_row_prefix_improvement);
prefix = prefix.replaceAll("\\[", "<").replaceAll("\\]", ">");
break;
}
return prefix + " " + changeText;
}
示例3: initAttrs
import it.gmariotti.changelibs.R; //导入依赖的package包/类
/**
* Init custom attrs.
*
* @param attrs
* @param defStyle
*/
protected void initAttrs(AttributeSet attrs, int defStyle) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(
attrs, R.styleable.ChangeLogListView, defStyle, defStyle);
try {
//Layout for rows and header
mRowLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowLayoutId, mRowLayoutId);
mRowHeaderLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowHeaderLayoutId, mRowHeaderLayoutId);
//Changelog.xml file
mChangeLogFileResourceId = a.getResourceId(R.styleable.ChangeLogListView_changeLogFileResourceId,mChangeLogFileResourceId);
mChangeLogFileResourceUrl = a.getString(R.styleable.ChangeLogListView_changeLogFileResourceUrl);
//String which is used in header row for Version
//mStringVersionHeader= a.getResourceId(R.styleable.ChangeLogListView_StringVersionHeader,mStringVersionHeader);
} finally {
a.recycle();
}
}
示例4: initAttrs
import it.gmariotti.changelibs.R; //导入依赖的package包/类
/**
* Init custom attrs.
*
* @param attrs
* @param defStyle
*/
protected void initAttrs(AttributeSet attrs, int defStyle) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ChangeLogListView, defStyle, defStyle);
try {
//Layout for rows and header
mRowLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowLayoutId, mRowLayoutId);
mRowHeaderLayoutId = a.getResourceId(R.styleable.ChangeLogListView_rowHeaderLayoutId, mRowHeaderLayoutId);
//Changelog.xml file
mChangeLogFileResourceId = a.getResourceId(R.styleable.ChangeLogListView_changeLogFileResourceId, mChangeLogFileResourceId);
//String which is used in header row for Version
//mStringVersionHeader= a.getResourceId(R.styleable.ChangeLogListView_StringVersionHeader,mStringVersionHeader);
} finally {
a.recycle();
}
}
示例5: initAdapter
import it.gmariotti.changelibs.R; //导入依赖的package包/类
/**
* Init adapter
*/
protected void initAdapter() {
try {
//Read and parse changelog.xml
XmlParser parse = new XmlParser(getContext(), mChangeLogFileResourceId);
//ChangeLog chg=parse.readChangeLogFile();
ChangeLog chg = new ChangeLog();
if (chg != null) {
//Create adapter and set custom attrs
mAdapter = new ChangeLogAdapter(getContext(), chg.getRows());
mAdapter.setmRowLayoutId(mRowLayoutId);
mAdapter.setmRowHeaderLayoutId(mRowHeaderLayoutId);
//Parse in a separate Thread to avoid UI block with large files
new ParseAsyncTask(mAdapter, parse).execute();
setAdapter(mAdapter);
} else {
setAdapter(null);
}
} catch (Exception e) {
Log.e(TAG, getResources().getString(R.string.changelog_internal_error_parsing), e);
}
}
示例6: doInBackground
import it.gmariotti.changelibs.R; //导入依赖的package包/类
@Override
protected ChangeLog doInBackground(Void... params) {
try {
if (mParse != null) {
ChangeLog chg = mParse.readChangeLogFile();
return chg;
}
} catch (Exception e) {
Log.e(TAG, getResources().getString(R.string.changelog_internal_error_parsing), e);
}
return null;
}
示例7: doInBackground
import it.gmariotti.changelibs.R; //导入依赖的package包/类
@Override
protected ChangeLog doInBackground(Void... params) {
try{
if (mParse!=null){
ChangeLog chg=mParse.readChangeLogFile();
return chg;
}
}catch (Exception e){
Log.e(TAG,getResources().getString(R.string.changelog_internal_error_parsing),e);
}
return null;
}