add get string to adapter's view holder
This commit is contained in:
parent
8a094680fb
commit
db07f8766b
|
|
@ -22,6 +22,7 @@ package ru.touchin.roboswag.components.adapters;
|
|||
import android.os.Looper;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
@ -410,6 +411,17 @@ public abstract class ObservableCollectionAdapter<TItem, TItemViewHolder extends
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply get String from resources.
|
||||
*
|
||||
* @param stringRes string resource id;
|
||||
* @return Requested String that matches with provided string resource id.
|
||||
*/
|
||||
@NonNull
|
||||
public String getString(@StringRes final int stringRes) {
|
||||
return itemView.getContext().getString(stringRes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue