本文整理匯總了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;
}