getString added to viewController
This commit is contained in:
parent
8641050754
commit
4ec2f70f2b
|
|
@ -22,6 +22,7 @@ package ru.touchin.roboswag.components.navigation;
|
|||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
|
@ -93,6 +94,26 @@ public class ViewController<TActivity extends ViewControllerActivity<?>,
|
|||
return container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a localized string from the application's package's default string table.
|
||||
*
|
||||
* @param resId Resource id for the string
|
||||
*/
|
||||
public final String getString(@StringRes final int resId) {
|
||||
return getActivity().getString(resId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a localized formatted string from the application's package's default string table, substituting the format arguments as defined in
|
||||
* {@link java.util.Formatter} and {@link java.lang.String#format}.
|
||||
*
|
||||
* @param resId Resource id for the format string
|
||||
* @param formatArgs The format arguments that will be used for substitution.
|
||||
*/
|
||||
public final String getString(@StringRes final int resId, final Object... formatArgs) {
|
||||
return getActivity().getString(resId, formatArgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls when activity configuring ActionBar, Toolbar, Sidebar etc.
|
||||
* If it will be called or not depends on {@link Fragment#hasOptionsMenu()} and {@link Fragment#isMenuVisible()}.
|
||||
|
|
|
|||
Loading…
Reference in New Issue