當前位置: 首頁>>代碼示例>>Java>>正文


Java R類代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:goodev,項目名稱:droidddle,代碼行數:27,代碼來源:ChangeLogListView.java

示例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;
}
 
開發者ID:goodev,項目名稱:droidddle,代碼行數:18,代碼來源:ChangeLogRow.java

示例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();
    }
}
 
開發者ID:Daniele-Comi,項目名稱:System-Monitor,代碼行數:27,代碼來源:ChangeLogListView.java

示例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();
    }
}
 
開發者ID:goodev,項目名稱:android-discourse,代碼行數:25,代碼來源:ChangeLogListView.java

示例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);
    }

}
 
開發者ID:goodev,項目名稱:android-discourse,代碼行數:29,代碼來源:ChangeLogListView.java

示例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;
}
 
開發者ID:goodev,項目名稱:droidddle,代碼行數:14,代碼來源:ChangeLogListView.java

示例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;
}
 
開發者ID:Daniele-Comi,項目名稱:System-Monitor,代碼行數:14,代碼來源:ChangeLogListView.java


注:本文中的it.gmariotti.changelibs.R類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。